https://linen.dev logo
Returning a string or meaningful input from Custom...
# help
a
Hi there,
CustomError
seems to not be outputting anything useful when I try to run my migrations. That's obviously not an issue with Rocket and is mostly because my sql schema file is bad but I'd like to at least output something to say that something went wrong since at the moment it just reads
Copy code
custom: CustomError:
k
CustomError is an alias for
anyhow::Error
, the simplest way to output a relevant message here is by using
anyhow::Context
like this:
a
ah right I see thanks, that makes sense - I must've glossed over it when looking at the example
k
No worries, I believe we only have this method in a few of the examples, we should probably do it in all of them.
CustomError
isn't very intuitive, and anyhow is a dependency of
shuttle-service
either way.