MalformedRequestContentRejection - typed error messages

20 просмотров
Перейти к первому непрочитанному сообщению

Tim Pigden

не прочитано,
18 авг. 2016 г., 11:48:3418.08.2016
– Akka User List
Hi
I have custom unmarshaller

I handle the output with 

case MalformedRequestContentRejection(msg, causeOpt) 
...

msg is a string
causeOpt is an Option[Throwable]

I want to pass typed data to this rejection handler.
If I could throw a typed exception somehow, I could match on causeOpt
But causeOpt is always None

So is there a way to pass typed data through to the Rejection message?

Konrad Malawski

не прочитано,
28 авг. 2016 г., 19:12:5028.08.2016
– Akka User List
Hi Tim,
I'm sorry but I don't quite get what you're after here?
Since you never know where your handler will be used, there is no way to have it strictly typed.
The exception handler should match on the type you're expecting and then do stuff with it.

HTH

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Cheers,
Konrad 'ktoso' Malawski

Tim Pigden

не прочитано,
28 авг. 2016 г., 20:29:2928.08.2016
– akka-user@googlegroups com
Konrad
The problem I have is whatever exception I throw nothing shows up in causeOpt
So it looks like there has been provision to send somethig back via causeOpt but I always get a return of None - hence I can't pattern match

I had assumed from the api signatures, that throwing a typed exception would result in the causeOpt being populated with Some(MyTypedException)




You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/Tl_tu2-guYY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+unsubscribe@googlegroups.com.

To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Tim Pigden
Optrak Distribution Software Limited
+44 (0)1992 517100
http://www.linkedin.com/in/timpigden
http://optrak.com
Optrak Distribution Software Ltd is a limited company registered in England and Wales.
Company Registration No. 2327613 Registered Offices: Suite 6,The Maltings, Hoe Lane, Ware, SG12 9LR England 
This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Optrak Distribution Software Ltd. If you are not the intended recipient of this email, you must neither take any action based upon its contents, nor copy or show it to anyone. Please contact the sender if you believe you have received this email in error.
Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений