[Opa] BUG somewhere

Cédric Soulas cedric.soulas at mlstate.com
Wed Dec 7 17:30:05 UTC 2011


Hi Matthieu,

Coincidentally, I was about to push an update to stdlib/core/outcome.opa:

   /**
    * Works like [get], except that you can choose the error message
    */
   get_msg = (fun_msg, s -> match s : outcome with
     | { ~success } -> success
-    | { failure = _ } -> error(fun_msg())
+    | { failure = e } -> error("{fun_msg()}\nReason: {e}")
   ) : (-> string), outcome('a, 'b) -> 'a


This will print the reason of the failure and give you a precious hint to debug your app.

Best,

Cédric


On Dec 7, 2011, at 6:15 PM, Matthieu Guffroy wrote:

> Hi,
> 
> I have a mysterious bug.
> 
> In console it is showing this red message :
> 
> File "stdlib/core/outcome.opa", line 69, characters 25-41, (69:25-69:41 | 1849-1865)
> @fail: Outcome.get called on {failure}
> [SESSION] Uncaught exception: "{fail: $"Outcome.get called on {failure}"$; position: $"File \"stdlib/core/outcome.opa\", line 69, characters 25-41, (69:25-69:41 | 1849-1865)"$}"
>   The following message is skipped.:
>     If you want (msg, st, ctx) debug printing set debug variable session_debug >= 200
> 
> 
> First question, how must I do to set the debug variable session_debug ?
> 
> And next, do you have some clue about this error ?
> 
> 
> 
> I'm doing investigation to find what generate this error, I will keep you informed.
> 
> --
> Matthieu GUFFROY
> 
> _______________________________________________
> Opa mailing list
> Opa at lists.owasp.org
> https://lists.owasp.org/mailman/listinfo/opa



More information about the Opa mailing list