Skip to content

Commit

Permalink
Added ability to override exception length
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin.schmick committed Jul 1, 2022
1 parent 5852d4b commit a2bb15e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/shipengine.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
'timeout' => env('SHIP_ENGINE_REQUEST_TIMEOUT', 'PT10S'),
'timeout_total' => env('SHIP_ENGINE_REQUEST_TIMEOUT_TOTAL', 'PT40S'),
'request_log_table_name' => env('SHIP_ENGINE_REQUEST_LOG_TABLE_NAME', 'ship_engine_request_logs'),
'request_log_table_exception_length' => env('SHIP_ENGINE_REQUEST_LOG_TABLE_EXCEPTION_LENGTH', 255),
'track_requests' => env('SHIP_ENGINE_TRACK_REQUESTS', true),
];
2 changes: 1 addition & 1 deletion src/ShipEngineClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private static function sendRequest(
);
} catch (Exception|Throwable $err) {
if (config('shipengine.track_requests')) {
$requestLog->exception = substr($err->getMessage(), 0, 255);
$requestLog->exception = substr($err->getMessage(), 0, config('shipengine.request_log_table_exception_length'));
$requestLog->save();
}

Expand Down

0 comments on commit a2bb15e

Please sign in to comment.