File size: 302 Bytes
36ba3ef
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * Creates a new error object with the given type and message.
 *
 * @param type - The error type.
 * @param message - The error message.
 *
 * @returns The error object.
 */
export function error (type: string, message: string): Error {
  const e = new Error(message)
  e.name = type
  return e
}