Skip to content

Commit ce7e836

Browse files
committed
Minor fixes.
1 parent 00106b0 commit ce7e836

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/naming/naming.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export class MoeraNaming {
307307
* Parse a node name and return its name and generation parts.
308308
*
309309
* If the node name does not include a generation, generation 0 is returned. If name syntax is invalid, ``Error``
310-
* is raised.
310+
* is thrown.
311311
*
312312
* @param {string} nodeName - the node name to be parsed
313313
* @return {[string, number]} [name, generation]

src/node/caller.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class MoeraNodeConnectionError extends Error {
5858
/**
5959
* Missing context of the call (authentication parameters or node URL).
6060
*/
61-
export class MoeraCallError extends Error {
61+
export class MoeraNodeCallError extends Error {
6262

6363
/**
6464
* @param {string} message - error message
@@ -211,7 +211,7 @@ interface CallOptions {
211211
*/
212212
auth?: boolean;
213213
/**
214-
* JSON schema to validate the response
214+
* JSON schema name to validate the response, or ``"blob"`` if the result is ``Buffer``
215215
*/
216216
schema: string;
217217
/**
@@ -368,18 +368,18 @@ export class Caller {
368368
} else if (this._carte != null) {
369369
bearer = "carte:" + this._carte;
370370
} else {
371-
throw new MoeraCallError("Carte is not set");
371+
throw new MoeraNodeCallError("Carte is not set");
372372
}
373373
break;
374374
case "admin":
375375
if (this._token == null) {
376-
throw new MoeraCallError("Token is not set");
376+
throw new MoeraNodeCallError("Token is not set");
377377
}
378378
bearer = "token:" + this._token;
379379
break;
380380
case "root-admin":
381381
if (this._rootSecret == null) {
382-
throw new MoeraCallError("Root secret is not set");
382+
throw new MoeraNodeCallError("Root secret is not set");
383383
}
384384
bearer = "secret:" + this._rootSecret;
385385
break;
@@ -390,7 +390,7 @@ export class Caller {
390390
}
391391

392392
if (this.root == null) {
393-
throw new MoeraCallError("Node URL is not set");
393+
throw new MoeraNodeCallError("Node URL is not set");
394394
}
395395

396396
let url = urlWithParameters(this.root + "/api" + location, params);

src/node/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
export { MoeraNode } from "./node";
2-
export { NodeAuth, MoeraNodeError, MoeraNodeApiError, MoeraNodeConnectionError, moeraRoot } from "./caller";
2+
export {
3+
NodeAuth,
4+
MoeraNodeError,
5+
MoeraNodeApiError,
6+
MoeraNodeConnectionError,
7+
MoeraNodeCallError,
8+
moeraRoot
9+
} from "./caller";
310
export { MoeraCarteSource, MoeraCartesError } from "./cartes";

0 commit comments

Comments
 (0)