mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	In preparation for v6, this PR removes usage and references to `error.description` instead favoring `error.message` (as mentioned #4380) I found no references in the front end, so this might be (I believe it to be) all the required changes.
		
			
				
	
	
		
			22 lines
		
	
	
		
			504 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			504 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { type ApiErrorSchema, UnleashError } from './unleash-error';
 | |
| 
 | |
| export default class ProjectWithoutOwnerError extends UnleashError {
 | |
|     statusCode = 409;
 | |
| 
 | |
|     constructor() {
 | |
|         super('A project must have at least one owner');
 | |
|     }
 | |
| 
 | |
|     toJSON(): ApiErrorSchema {
 | |
|         return {
 | |
|             ...super.toJSON(),
 | |
|             details: [
 | |
|                 {
 | |
|                     message: this.message,
 | |
|                     validationErrors: [],
 | |
|                 },
 | |
|             ],
 | |
|         };
 | |
|     }
 | |
| }
 |