Lets say I have an exception defined as below:
exception MyException of string
I raise it in a function (this function returns string) as follows:
fun foo ... = raise DomenaInterpretacije ("Error ...")
| foo ... ...
Then I call that functon in a way, that produces the exception:
fun testExc () =
(foo ...)
handle MyException msg => msg
But these yields:
Error: non-constructor applied to argument in pattern: MyException
Error: unbound variable or constructor: msg
What am I doing wrong here?
The exception was actually defined inside a module, so I had to call it like MyModule.MyException msg.