std/assert/assertion_error.ts
Asher Gomez 8efc049ddf
chore(assert): remove redundant constructor example (#5506)
chore(assert): remove constructor example
2024-07-23 12:04:10 +09:00

24 lines
529 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.
/**
* Error thrown when an assertion fails.
*
* @example Usage
* ```ts no-eval
* import { AssertionError } from "@std/assert";
*
* throw new AssertionError("Assertion failed");
* ```
*/
export class AssertionError extends Error {
/** Constructs a new instance.
*
* @param message The error message.
*/
constructor(message: string) {
super(message);
this.name = "AssertionError";
}
}