https://github.com/erfanium/wrap_error
Wrap JavaScript promise errors
https://github.com/erfanium/wrap_error
deno
Last synced: about 2 months ago
JSON representation
Wrap JavaScript promise errors
- Host: GitHub
- URL: https://github.com/erfanium/wrap_error
- Owner: erfanium
- License: mit
- Created: 2021-08-23T20:48:08.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-24T16:51:58.000Z (almost 5 years ago)
- Last Synced: 2025-03-07T09:35:27.942Z (over 1 year ago)
- Topics: deno
- Language: TypeScript
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wrap_error
Wrap JavaScript promise errors
```ts
import { wrapError } from "./mod.ts";
async function isDenoOk(): Promise {
const [error, response] = await wrapError(fetch("https://deno.land"));
return !error && response!.status === 200;
}
const status = await isDenoOk();
console.log(status);
```