-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove unneeded ErrorKinds #3936
Conversation
cli/deno_error.rs
Outdated
@@ -252,6 +247,8 @@ impl GetErrorKind for DlopenError { | |||
} | |||
} | |||
|
|||
// NOTE(bartlomieju): seems this is necessary - can't use ErrBox here | |||
// TODO(bartlomieju): ultimately this should be rewritten to `RuntimeError`? | |||
impl GetErrorKind for dyn AnyError { | |||
fn kind(&self) -> ErrorKind { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this impl is necessary. I suggest:
fn kind(&self) -> ErrorKind {
unreachable!()
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, it seems necessary, tried to remove that and doesn't work. Need to figure this out
@ry I'd prefer to land this PR as is if CI goes green. We should be able to rewrite the rest tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing approval since work is still in progress. Needs a final review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some comments - but I guess they're addressed in your next patch.
Follow up to #3662
DenoError.Other
withError
DenoError.UrlParse
,DenoError.InvalidPath
andDenoError.ImportMissingPrefix
withURIError
DenoError.Http
withHttpError
(?) - the same error thatfetch
throwsIoError
(?)NotFound
PermissionDenied
ConnectionRefused
ConnectionReset
ConnectionAborted
NotConnected
AddrInUse
AddrNotAvailable
BrokenPipe
AlreadyExists
removedWouldBlock
- shouldn't be usedInvalidInput
-TypeError
InvalidData
-(possible justTypeError
Error
?)TimedOut
Interrupted
- shouldn't be usedWriteZero
UnexpectedEof
BadResource
InvalidSeekMode
withTypeError
TooLarge
withError
UnixError
withSystemError
(?) -> explode that to ERRNO, map ERRNO to Deno defined errors, if one does not exist then panicDiagnostic
andJSError