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

SocketException is not properly handled #18

Closed
zerg000000 opened this issue Oct 30, 2023 · 3 comments
Closed

SocketException is not properly handled #18

zerg000000 opened this issue Oct 30, 2023 · 3 comments

Comments

@zerg000000
Copy link

When SocketException is thrown, we will receive the following exception

java.lang.UnsupportedOperationException: nth not supported on this type: SocketException

Since we are trying to destruct Exception as a vector at this line

(let [[_setname-ok? response]

we could fix this by changing the return value in (catch ...). e.g.

(try
  ...
 (catch Exception ex
    [false ex])
@oliyh
Copy link
Owner

oliyh commented Oct 30, 2023

Hi,

Thanks for writing this up.

I wonder if this behaviour could or should also be changed in carmine, to make its API more consistent? But yes, I think carmine-streams should guard against this.

@zerg000000
Copy link
Author

zerg000000 commented Oct 31, 2023

It should match the destructuring.

(let [[_setname-ok? response]
      (try
        ... ;; should return [ v1 v2 ]
       (catch Exception e
         ... ;; should also return [ v1 v2 ], currently return e
        ))]
  ...
)

@oliyh oliyh closed this as completed in fbd351c Nov 2, 2023
@oliyh
Copy link
Owner

oliyh commented Nov 2, 2023

Hi,

Please try version 0.2.2 on clojars

Thanks

This issue was closed.
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

2 participants