Skip to content
party.js logoparty.js logo

ReferenceUtilitiesClass

PartyJSError

The error party.js throws for invalid input.

extends Error

The error party.js throws when it’s given invalid input, for example a color string it cannot parse.

Its error message is prefixed with [party-js].

try {
confetti(button, { colors: gradient([]) });
} catch (error) {
if (error instanceof PartyJSError) showHint(error.message);
else throw error;
}
new PartyJSError(message: string);
messagestring