Skip to content
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

Swift wrapper, DidResolver not able to accept error callback with error kind, rust panic #103

Open
ivanpagac opened this issue Jan 10, 2023 · 0 comments

Comments

@ivanpagac
Copy link

As a user I would like to be able to know why resolution of did document failed, e.g. network error or simply not found. The API is available such as

public protocol DidResolver: AnyObject {
    func resolve(did: String, cb: OnDidResolverResult) -> ErrorCode
}

but when trying to invoke

try cb.error(err: .InvalidState(message: did), msg: "NetworkError")

then nor ErrorKind or msg is propagated to pack or unpack methods on error closure.

public func unpack(msg: String, options: UnpackOptions, cb: OnUnpackResult) -> ErrorCode
public protocol OnUnpackResult: AnyObject {
    func success(result: Message, metadata: UnpackMetadata)
    func error(err: ErrorKind, msg: String)
}

In the above err is always

(lldb) po error
▿ ErrorKind
  ▿ InvalidState : 1 element
    - message : "Invalid state"

and msg is always

(lldb) po msg
"Invalid state: Unable resolve signer did: can not resolve DID Doc: Invalid state: unable receive callback result: oneshot canceled: unable receive callback result: oneshot canceled"

What I would expect is ErrorKind is correctly propagated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant