-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: apply suggestions from code review
Co-authored-by: Alan Shaw <[email protected]>
- Loading branch information
1 parent
c8a4a82
commit b13a6ae
Showing
9 changed files
with
29 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"build": "node scripts/cli.js build", | ||
"dev": "miniflare --watch --debug", | ||
"deploy": "wrangler publish --env production", | ||
"pretest": "npm run build ", | ||
"pretest": "npm run build", | ||
"test": "npm-run-all -p -r mock:ipfs.io test:worker", | ||
"test:worker": "ava --verbose test/*.spec.js", | ||
"mock:ipfs.io": "smoke -p 9081 test/mocks/ipfs.io" | ||
|
@@ -27,5 +27,5 @@ | |
"smoke": "^3.1.1" | ||
}, | ||
"author": "Vasco Santos <[email protected]>", | ||
"license": "(Apache-2.0 AND MIT)" | ||
"license": "Apache-2.0 OR MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
import { JSONResponse } from './utils/json-response.js' | ||
|
||
/** | ||
* @param {Error & {status?: number;code?: string;}} err | ||
*/ | ||
export function errorHandler(err) { | ||
// TODO: setup sentry | ||
console.error(err.stack) | ||
|
||
let error = { | ||
code: err.code || 'HTTP_ERROR', | ||
message: err.message || 'Server Error', | ||
} | ||
let status = err.status || 500 | ||
|
||
return new JSONResponse(error, { status }) | ||
return new Response(err.message || 'Server Error', { status }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters