Add custom errors to docs (#4480)
This commit is contained in:
26
docs/templates/contract.hbs
vendored
26
docs/templates/contract.hbs
vendored
@ -57,6 +57,23 @@ import "@openzeppelin/{{__item_context.file.absolutePath}}";
|
||||
--
|
||||
{{/if}}
|
||||
|
||||
{{#if has-errors}}
|
||||
[.contract-index]
|
||||
.Errors
|
||||
--
|
||||
{{#each inheritance}}
|
||||
{{#unless @first}}
|
||||
[.contract-subindex-inherited]
|
||||
.{{name}}
|
||||
{{/unless}}
|
||||
{{#each errors}}
|
||||
* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`]
|
||||
{{/each}}
|
||||
|
||||
{{/each}}
|
||||
--
|
||||
{{/if}}
|
||||
|
||||
{{#each modifiers}}
|
||||
[.contract-item]
|
||||
[[{{anchor}}]]
|
||||
@ -83,3 +100,12 @@ import "@openzeppelin/{{__item_context.file.absolutePath}}";
|
||||
{{{natspec.dev}}}
|
||||
|
||||
{{/each}}
|
||||
|
||||
{{#each errors}}
|
||||
[.contract-item]
|
||||
[[{{anchor}}]]
|
||||
==== `[.contract-item-name]#++{{name}}++#++({{typed-params params}})++` [.item-kind]#error#
|
||||
|
||||
{{{natspec.dev}}}
|
||||
|
||||
{{/each}}
|
||||
|
||||
4
docs/templates/properties.js
vendored
4
docs/templates/properties.js
vendored
@ -35,6 +35,10 @@ module.exports['has-events'] = function ({ item }) {
|
||||
return item.inheritance.some(c => c.events.length > 0);
|
||||
};
|
||||
|
||||
module.exports['has-errors'] = function ({ item }) {
|
||||
return item.inheritance.some(c => c.errors.length > 0);
|
||||
};
|
||||
|
||||
module.exports['inherited-functions'] = function ({ item }) {
|
||||
const { inheritance } = item;
|
||||
const baseFunctions = new Set(inheritance.flatMap(c => c.functions.flatMap(f => f.baseFunctions ?? [])));
|
||||
|
||||
Reference in New Issue
Block a user