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)
- LSP workspace does not recognize package `imports` field in config
- jsxImportSource freezes lsp when not in workspace
- Cannot use jsr.json as workspace member outside deno publish HOT 7
- 'main' panicked HOT 1
- Support bare specifiers for npm package members in a workspace
- bug(net): http2 protocol error since deno 1.45
- Bug: Command `deno add` logs error for JSR package without default export
- Bug: LSP errors in VSCode opening built-in Typescript/Deno `d.ts` files HOT 1
- Publishing JSR pkg that resolves to npm workspace member that's a JSR dep should error?
- deno compile: node addons gets error `missing symbol called`
- Compilation error during cargo install HOT 4
- `node:tty` -> N.WriteStream.prototype.hasColors is not a function
- File with just `+` does not report syntax error HOT 3
- Websocket behaviour change since 1.44.3 HOT 4
- No way to specify specific abstract socket name with `--allow-read/write`.
- Import error on startup when a Fresh project is a workspace member HOT 3
- Non-zero exit code in a test case causes the test to fail since 1.44.0
- `deno test --watch` should always print the full test output HOT 2
- proposal: add `Deno.ConfigFile` HOT 4
- βclient error (SendRequest)β when fetching certain https URLs over proxy HOT 7
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.