enaklo-flutter/lib/common/api/interceptors/not_found_interceptor.dart

14 lines
358 B
Dart
Raw Normal View History

2025-08-27 12:43:25 +07:00
import 'package:dio/dio.dart';
import '../errors/not_found_error.dart';
class NotFoundErrorInterceptor extends Interceptor {
@override
void onError(DioException err, ErrorInterceptorHandler handler) {
if (err.response?.statusCode == 404) {
return super.onError(NotFoundError(err, null), handler);
}
super.onError(err, handler);
}
}