ComponentEmbedErrorCode
Error codes for component embed issues. You can branch on them to handle different
kinds of errors programmatically using the code property.
InvalidStructure: a wrong root, a component in the wrong place, a parent with the wrong number of children, an emptyTextDisplay, text outside one, or a Vue VNode. FromfromPayload, also JSON where a component or gallery item isn't an object, a type a component embed doesn't take, or a button that isn't a link button.InvalidProp: a prop with the wrong type or value, like aspacingof'medium'or a URL with a bad scheme. FromfromPayload, also a key a component doesn't take, a badid, or a list,content,media, oremojiwith the wrong shape.OverLimit: a length, count, or byte limit Discord sets.UnsupportedComponent: amemo,lazy,forwardRef, context, class, or async component.ReadFailed: a component or an iterator of yours threw while the package read the tree. The original error is oncause.
type ComponentEmbedErrorCode =
| "InvalidStructure"
| "InvalidProp"
| "OverLimit"
| "UnsupportedComponent"
| "ReadFailed";