Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpassos committed Dec 20, 2024
1 parent 51e6635 commit e14a106
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/src/bones_api_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,17 @@ abstract class APIRoot with Initializable, Closable {
/// Returns the current [APIRequest] of the current [call].
final ZoneField<APIRequest> currentAPIRequest = ZoneField(Zone.current);

static const _callZonedErrorHeader = '__callZoned__';

late final _callZoneSpecification = ZoneSpecification(
handleUncaughtError: (self, parent, zone, error, stackTrace) {
static void _uncaughtAsynchronousError(Zone self, ZoneDelegate parent,
Zone zone, Object error, StackTrace stackTrace) {
var request = zone['APIRequest'];
_log.severe("Uncaught asynchronous error while calling: $request", error,
stackTrace);
});
}

static final _callZoneSpecification =
ZoneSpecification(handleUncaughtError: _uncaughtAsynchronousError);

static const _callZonedErrorHeader = '__callZoned__';

FutureOr<APIResponse<T>> _callZoned<T>(
APIRequest request, bool externalCall) {
Expand Down

0 comments on commit e14a106

Please sign in to comment.