Skip to content

Commit

Permalink
fix: vb and correct error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Elin Angelow committed Jul 23, 2024
1 parent 799e6d1 commit 685ca93
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
node-version: "lts/*"
- name: Install dependencies
run: npm i --package-lock-only && npm clean-install
- name: Tests and docs
run: npm run unit-test && npm run gdocs
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion lib/methods/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ const Methods = ({
mr.params = r;
} catch (e) {
mr.params = undefined;
mr.error = e?.error?.stack || e?.stack || e?.error || e;
mr.error = (e?.error?.stack && e?.error) ||
(e?.stack && e);
this.log('error', 'Methods', mr.error, callData);
}
if (!data.id) {
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
"error": "^10.4.0"
},
"devDependencies": {
"jsdoc": "^4.0.3",
"jsdoc-tsimport-plugin": "^1.0.5",
"typescript": "^5.3.3",
"semantic-release": "^22.0.12",
"tap": "^18.6.1"
"semantic-release": "^24.0.0",
"tap": "^18.6.1",
"typescript": "^5.3.3"
},
"scripts": {
"unit-test": "./node_modules/.bin/tap --snapshot-clean-cwd --coverage-report=html ./tests/unit/ ",
"gdocs": "jsdoc -c jsdoc.json . | npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types"
"gdocs": "node_modules/jsdoc/jsdoc.js -c jsdoc.json . | npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types"
},
"homepage": "https://github.com/zetxx/bridg-wrong/blob/master/README.md",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion types/lib/methods/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ declare function Methods({ wires, list: externalList, config }: {
wires: any;
list: any;
config?: {};
}): import('./types.js').Api;
}): import("./types.js").Api;
8 changes: 4 additions & 4 deletions types/lib/methods/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ export const unused: {};
export type add = () => any;
export type remove = () => any;
export type find = () => any;
export type ask = (message: import('../types.js').message) => Promise<any>;
export type notify = (message: import('../types.js').message) => Promise<any>;
export type send = (message: import('../types.js').message) => void;
export type test = (data: import('../types.js').message, ctx: any) => any;
export type ask = (message: import("../types.js").message) => Promise<any>;
export type notify = (message: import("../types.js").message) => Promise<any>;
export type send = (message: import("../types.js").message) => void;
export type test = (data: import("../types.js").message, ctx: any) => any;
export type log = (level: string, logData: any) => void;
export type responseMethodName = (p: object, id: string | number) => string;
export type Api = {
Expand Down
2 changes: 1 addition & 1 deletion types/lib/wires/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export = Wires;
* Wires bootstrap
* @returns {import('./types').Api}
*/
declare function Wires(): import('./types').Api;
declare function Wires(): import("./types").Api;

0 comments on commit 685ca93

Please sign in to comment.