
27 Sep
2012
27 Sep
'12
3:43 p.m.
On Thu, Sep 27, 2012 at 9:25 PM, Chaddaï Fouché
body <- try (simpleHttp "http://www.google.com") case body of Left (SomeException _) -> jsonToRepJson $ object ["response" .= ( show "ERROR: NO DATA FOR ONE REASON OR ANOTHER")]
I think that should work...
Since the signature was made necessary by the ambiguity on which type of exception you wished to catch with your "try", using (SomeException _) in your pattern match should make that clear. By the way, why are you show()ing a String ? The only thing that does is adding quotes around it and escaping some characters, shouldn't you just use :
Left (SomeException _) -> jsonToRepJson $ object ["response" .= "ERROR: NO DATA FOR ONE REASON OR ANOTHER"]
-- Jedaï