2.0.5 • Published 5 years ago
@onedaycat/ts-error v2.0.5
ts-error
A library to create application error, there are 8 definition type that including
- BAD_REQUEST
- NOT_FOUND
- TIMEOUT
- FORBIDDEN
- UNAUTHORIZED
- MAINTENANCE
- VALIDATION_ERROR
- INTERNAL_ERROR
Install
npm install @onedaycat/ts-error
Usage
import { def } from '@onedaycat/ts-error';
// define application error
const error = {
userNotFound: def.notFound('user_not_found', 'user not found');
productNotFound: def.notFound('product_not_found', 'product not found');
}
try {
// do stuff
} catch (e) {
// throw application error that defined instead
throw error.userNotFound.new().withCause(e);
}
Contributing
- Fork this repository.
- Create new branch with feature name in format
feature/FEATURE_NAME
- Run
npm install
oryarn
- Create your feature.
- Commit and set commit message with feature name.
- Push your code to your fork repository.
- Create pull request.
2.0.5
5 years ago
2.0.3
5 years ago
2.0.2
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.3.6
5 years ago
1.3.5
5 years ago
1.3.4
5 years ago
1.3.3
5 years ago
1.3.2
5 years ago
1.3.1
5 years ago
1.3.0
5 years ago
1.2.15
5 years ago
1.2.14
5 years ago
1.2.13
5 years ago
1.2.12
5 years ago
1.2.11
5 years ago
1.2.10
5 years ago
1.2.9
5 years ago
1.2.8
5 years ago
1.2.7
5 years ago
1.2.6
5 years ago
1.2.5
5 years ago
1.2.4
5 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.0
6 years ago