Skip to content

Commit bb21226

Browse files
committed
add example
1 parent f839795 commit bb21226

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

example/main.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:laravel_exception/laravel_exception.dart';
2+
3+
void main(List<String> args) {
4+
dynamic res;
5+
if (res.statusCode == 422) {
6+
throw LValidationException(res.data);
7+
} else if (res.statusCode == 500) {
8+
throw LServerException.parse(res.data);
9+
} else if (res.statusCode == 404) {
10+
throw LNotFoundException.parse(res.data);
11+
}
12+
}

0 commit comments

Comments
 (0)