mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
20 lines
446 B
TypeScript
20 lines
446 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
/**
|
|
* Error thrown when an assertion fails.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* import { AssertionError } from "@std/assert/assertion_error";
|
|
*
|
|
* throw new AssertionError("Assertion failed");
|
|
* ```
|
|
*/
|
|
export class AssertionError extends Error {
|
|
/** Constructs a new instance. */
|
|
constructor(message: string) {
|
|
super(message);
|
|
this.name = "AssertionError";
|
|
}
|
|
}
|