librelist archives

« back to archive

Error Handling: Getting Timeouts Instead of Exceptions

Error Handling: Getting Timeouts Instead of Exceptions

From:
Jake Greene
Date:
2014-06-30 @ 17:29
I have a thin wrapper over Brando which will send requests and then handle
any errors in the response.
The brando unit tests make me believe that I should expect the following 
for all error cases:


val badargs = brando ? Request("SET", "key”)

Await.result(badargs, 10.milliseconds)

brando.BrandoException: ERR wrong number of arguments for 'set’ command


But when I send a request with a bad command name I get a timeout:


val failure = brando ? Request("noCommand", "arg”)

Await.result(failure, 10.milliseconds)

akka.pattern.AskTimeoutException: Ask timed out on 
[Actor[akka://brando-test-system/user/$a#601405373]] after [10 ms]


I expect to receive a BrandoException with the error message: ERR unknown 
command ‘noCommand’

Is this a bug in Brando’s error message parsing or have I misunderstood 
the expected behaviour?

Re: [brando] Error Handling: Getting Timeouts Instead of Exceptions

From:
Chris Dinn
Date:
2014-06-30 @ 17:44
Your expectations are correct, it very much looks like a bug in the error 
reply parsing. 

If that's the case, it sounds pretty reproducible and should be a quick 
fix. If you want to send a PR I'd much appreciate it, otherwise I should 
be able to get to it at some point over the next few days. 

--Chris

> On Jun 30, 2014, at 1:29 PM, Jake Greene <jake.greene@nurun.com> wrote:
> 
> I have a thin wrapper over Brando which will send requests and then 
handle any errors in the response. 
> The brando unit tests make me believe that I should expect the following
for all error cases:
> 
> val badargs = brando ? Request("SET", "key”)
> Await.result(badargs, 10.milliseconds)
> brando.BrandoException: ERR wrong number of arguments for 'set’ command
> 
> But when I send a request with a bad command name I get a timeout:
> 
> val failure = brando ? Requ est("noCommand", "arg”)
> Await.result(failure, 10.milliseconds)
> akka.pattern.AskTimeoutException: Ask timed out on 
[Actor[akka://brando-test-system/user/$a#601405373]] after [10 ms]
> 
> I expect to receive a BrandoException with the error message: ERR 
unknown command ‘noCommand’
> Is this a bug in Brando’s error message parsing or have I misunderstood 
the expected behaviour?