Files
mlugg 0a889b2ab1 Update @actions/cache to 4.0.2
Version 3 of `@actions/cache` is now deprecated, and can cause runs to
fail; see https://github.com/actions/toolkit/blob/main/packages/cache/README.md.

I have no fucking clue why this was considered a major release; it's
explicitly documented as being entirely backwards-compatible. SemVer be
damned, amirite?
2025-03-10 17:01:15 +00:00

37 lines
1.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RpcError = void 0;
/**
* An error that occurred while calling a RPC method.
*/
class RpcError extends Error {
constructor(message, code = 'UNKNOWN', meta) {
super(message);
this.name = 'RpcError';
// see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#example
Object.setPrototypeOf(this, new.target.prototype);
this.code = code;
this.meta = meta !== null && meta !== void 0 ? meta : {};
}
toString() {
const l = [this.name + ': ' + this.message];
if (this.code) {
l.push('');
l.push('Code: ' + this.code);
}
if (this.serviceName && this.methodName) {
l.push('Method: ' + this.serviceName + '/' + this.methodName);
}
let m = Object.entries(this.meta);
if (m.length) {
l.push('');
l.push('Meta:');
for (let [k, v] of m) {
l.push(` ${k}: ${v}`);
}
}
return l.join('\n');
}
}
exports.RpcError = RpcError;