Skip to content

Commit

Permalink
use rethrow when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorUvarov authored and mikaelwills committed Dec 18, 2024
1 parent be291a3 commit 014d866
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ analyzer:
avoid_types_as_parameter_names: ignore
empty_catches: ignore
unawaited_futures: ignore
use_rethrow_when_possible: ignore
unused_import: ignore
must_be_immutable: ignore
todo: ignore
Expand Down
2 changes: 1 addition & 1 deletion lib/src/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,6 @@ void load(Settings src, Settings? dst) {
});
} catch (e) {
logger.e('Failed to load config: ${e.toString()}');
throw e;
rethrow;
}
}
4 changes: 2 additions & 2 deletions lib/src/rtc_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,7 @@ class RTCSession extends EventManager implements Owner {
'User Denied Media Access');
logger.e('emit "getusermediafailed" [error:${error.toString()}]');
emit(EventGetUserMediaFailed(exception: error));
throw error;
rethrow;
}
}

Expand Down Expand Up @@ -2406,7 +2406,7 @@ class RTCSession extends EventManager implements Owner {
return;
}
logger.e('Failed to _sendInitialRequest: ${error.toString()}');
throw error;
rethrow;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/transports/tcp_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class SIPUATcpSocket extends SIPUASocketInterface {
return true;
} catch (error) {
logger.e('send() | error sending message: $error');
throw error;
rethrow;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/transports/web_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class SIPUAWebSocket extends SIPUASocketInterface {
return true;
} catch (error) {
logger.e('send() | error sending message: $error');
throw error;
rethrow;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/transports/websocket_dart_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class SIPUAWebSocketImpl {
return webSocket;
} catch (e) {
logger.e('error $e');
throw e;
rethrow;
}
}
}
4 changes: 2 additions & 2 deletions lib/src/ua.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class UA extends EventManager {
} catch (e) {
_status = C.STATUS_NOT_READY;
_error = C.CONFIGURATION_ERROR;
throw e;
rethrow;
}

// Initialize registrator.
Expand Down Expand Up @@ -821,7 +821,7 @@ class UA extends EventManager {
try {
config.load(configuration, _configuration);
} catch (e) {
throw e;
rethrow;
}

// Post Configuration Process.
Expand Down

0 comments on commit 014d866

Please sign in to comment.