INNER CODE UNIT · TypeScript
wrapError
yume-chan/ya-webadb · libraries/adb-credential-nodejs/src/index.ts:53
function wrapError(e: unknown, creator: (e: unknown) => KeyError) {
return e instanceof KeyError ? e : creator(e);
}
/**
* Can't read or parse a vendor key.
*
* Check `path` for file path, and `cause` for the error.
*/
class VendorKeyError extends KeyError {
constructor(path: string, options?: ErrorOptions) {
super(`Can't read vendor key file at "${path}"`, path, options);
}
}
export class TangoNodeStorage implements TangoKeyStorage {
static readonly KeyError = KeyError;
static readonly InvalidKeyError = InvalidKeyError;