mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-31 05:24:13 +00:00 
			
		
		
		
	* chore: Add the SPDX information to each file Add copyright and licensing information as defined in version 3.0 of the REUSE Specification. * tweak format --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			558 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			558 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /*
 | |
|  * SPDX-FileCopyrightText: syuilo and other misskey contributors
 | |
|  * SPDX-License-Identifier: AGPL-3.0-only
 | |
|  */
 | |
| 
 | |
| export class StatusError extends Error {
 | |
| 	public statusCode: number;
 | |
| 	public statusMessage?: string;
 | |
| 	public isClientError: boolean;
 | |
| 
 | |
| 	constructor(message: string, statusCode: number, statusMessage?: string) {
 | |
| 		super(message);
 | |
| 		this.name = 'StatusError';
 | |
| 		this.statusCode = statusCode;
 | |
| 		this.statusMessage = statusMessage;
 | |
| 		this.isClientError = typeof this.statusCode === 'number' && this.statusCode >= 400 && this.statusCode < 500;
 | |
| 	}
 | |
| }
 |