Content pfp
Content
@
0 reply
0 recast
0 reaction

Mark Tyneway pfp
Mark Tyneway
@tynes
What are best practices for custom errors? - When should they include arguments? - Should there be many diff error types or more generic errors that accept arguments to differentiate error cases?
2 replies
2 recasts
8 reactions

Jem pfp
Jem
@jem
As long as you have enough space in the contract, I'd go for more verbose/specialised errors, as it makes it easier for a third-party to diagnose the cause of the error. I've also started putting the errors (alongside other functions, state variable functions, etc) into an interface, to save devs having to import the implementation.
0 reply
0 recast
0 reaction