purescript-book
purescript-book copied to clipboard
Chapter 12 - treating an `Error` as a `String`?
Hello!
I was finding that I was getting a runtime TypeError when taking the Left
path on the exercises in 12.7. I suspect that we're expecting the argument to the request
onError callback to be a String
when it is potentially something like a JavaScript Error
object. If I explicitly cast to string in Client.js
I no longer get that runtime TypeError.
Of course I might be misunderstanding something!
This indicates both callbacks come from String
, no?
What if this is not a string?