Comments (6)
I see, I may be thinking about this wrong.
I'd like to see what caused the error, as I think the ConnectionRefused
is too vague. Perhaps it's better to add some details to it instead.
The more I think about it, the more it makes sense for Postgres.js to instead add a cause
to its error(s) and wrap the ConnectionRefused
🤔
from deno.
@oles I'm still not sure how that would work - the error you see above is an instance of Deno.errors.ConnectionRefused
. The way it is constructed is that when a relevant native (Rust) API raises it, it's translated to that instance. There's no underlying "cause" or other error that could be "linked".
I think I'm missing a point here, so any further explanation would be helpful 😅
from deno.
What would the cause
be set it?
from deno.
Based on the stack trace, I think it should be the cachedError
- the error just before ConnectionRefused
is thrown - but I'm not fully sure.
I've at least written code before that was similar to the currently first MDN example, which would result in what I think - it seems.
try {
connectToDatabase();
} catch (err) {
throw new Error("Connecting to database failed.", { cause: err });
}
from deno.
Sorry I'm a bit confused here. Is this issue about adding cause
field to all instance of Deno.errors.*
classes? Or is it about the fact that if you pass one of these instances to { cause: err}
it doesn't work properly?
from deno.
Sorry for the confusion! I could likely have been clearer.
Adding a cause
field to all instances of the Deno.errors.*
is what I mean, yes :)
from deno.
Related Issues (20)
- crypto.subtle.importKey with verify raises "Invalid key usages" HOT 2
- Resolving `npm:express` and `npm:express-openid-connect` results with `Deno has panicked.` HOT 1
- Node:http localAddress not supported in compat
- parser-ts fails to work in deno HOT 1
- npm @gutenye/ocr-node doesn't work correctly
- Will the `curl -fsSL https://deno.land/install.sh | sh` URL install Deno 2.0 (i.e. breaking changes) once 2.0 is released? HOT 2
- [node] deasync package doesn't work in Deno CLI HOT 1
- workspaces: Always walk up to the root of the file system unless you encounter a deno.json(c) file with "workspace" key
- workspaces: Do not allow to use two different workspaces in subcommands that accept multiple entrypoints
- workspaces: Lockfile should be placed next to the workspace config file
- workspaces: Specify behavior of `deno install` when in a workspace context
- workspaces: Specify behavior of `package.json` in context of Deno workspace
- Doc tests don't play nice with blockquotes in markdown
- `mkdir()` incorrectly returns `undefined` and produces unexpected subsequent results
- Deprecate / Remove `--lock-write` HOT 1
- Way to resolve npm file imports like npm:lib/bin.wasm HOT 2
- `import.meta.resolve` does not resolve `npm:` specifiers that have not been loaded already but are in a package that is already loaded HOT 1
- `Deno.open` successfully opens folders on linux HOT 1
- devcontainer with denoland/deno:alpine not working HOT 2
- Expose `zstd` compress to js code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno.