Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom errors #342

Open
PaulRBerg opened this issue Dec 8, 2021 · 3 comments
Open

Support custom errors #342

PaulRBerg opened this issue Dec 8, 2021 · 3 comments

Comments

@PaulRBerg
Copy link
Contributor

Custom errors cannot be configured to be included in the Markdown report.

When I run solidity-docgen over a contract with lots of custom errors (such as the BalanceSheet), the custom errors are not included in the output.

@frangio
Copy link
Contributor

frangio commented Dec 10, 2021

Thanks for pointing this out! I'd like to fix this, hope I get the time. 🙏

@frangio
Copy link
Contributor

frangio commented Jan 18, 2022

@PaulRBerg This is solved in the upcoming rewrite (#350). I'll try it out with the contract that you shared!

Can you share an example of what you'd like the output to look like for errors?

@PaulRBerg
Copy link
Contributor Author

PaulRBerg commented Jan 19, 2022

This is solved in the upcoming rewrite (#350)

Glad to hear.

Can you share an example of what you'd like the output to look like for errors?

Well custom errors are annotated with NatSpec comments, just like any other function. So treating them as functions would be a good solution to start with. The only difference would be that the errors would be placed under another upper header "Custom Errors", and not under "Functions".

To take BalanceSheet__BorrowMaxBonds as an example, this is the Markdown output that I would like to see when using our Handlebars template:

## Custom Errors

### BalanceSheet__BorrowMaxBonds

\```solidity
error BalanceSheet__BorrowMaxBonds(
    IHToken bond,
    uint256 newBondListLength,
    uint256 maxBonds
);
\```

Emitted when the account exceeds the maximum numbers of bonds permitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants