-
Notifications
You must be signed in to change notification settings - Fork 27
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
Spec Proposal: Switch to ErrorCodes instead of pre-defined error classes #41
Comments
Agreed, a property on the error would be a much better solution overall.
We should stick with something more unix like and make error codes > 0, especially since |
Absolutely, silly oversight on my part. I'm also curious if we should pass the underlying rpc error code (if there was one) to the consumer as well, much like MetaMask. I imagine this would be very difficult across multiple implementations. |
Yeah, I think between multiple implementations + custodial wallets, WebLN should avoid anything overly specific to the underlying Lightning node. |
A helper library to convert node-specific error messages to WebLN error messages would be sick. |
In the docs, we're told to check for a provider error based on the
Error
constructor value like so:I think if we used an int instance property
errorCode
instead it would de-couple the webln spec from this specific implementation. We could call the property something likewebLnErrorCode
and have the values be an int.Benefits to Providers
Benefits to webln supporting Apps
Rough mapping
RejectionErrorUserRejectionErrorThe best for last
The text was updated successfully, but these errors were encountered: