Skip to content

Commit

Permalink
Fix Errormessages
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Jan 23, 2024
1 parent c53f688 commit 3575fa9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions libs/FritzBoxBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,19 @@ protected function SendEx(string $Function, int $Index, array $Parameter = [])
$Result = unserialize($Ret);
if (is_a($Result, 'SoapFault')) {
if (property_exists($Result, 'detail')) {
$Details = $Result->detail->{$Result->faultstring};
$Detail = $Result->faultstring . '(' . $Details->errorCode . ')';
$this->SendDebug($Detail, $Details->errorDescription, 0);
trigger_error($Detail . "\r\n" . (new Exception())->getTraceAsString() . "\r\n" . $Details->errorDescription, E_USER_WARNING);
$Details = $Result->detail;
if ($Details) {
if (property_exists($Details, $Result->faultstring)) {
$Details = $Details->{$Result->faultstring}->errorDescription . "\r\n";
} else {
$Details = '';
}
} else {
$Details = '';
}
$Detail = $Result->faultstring . '(' . $Result->faultcode . ')';
$this->SendDebug($Detail, $Details, 0);
trigger_error($Detail . "\r\n" . $Details . (new Exception())->getTraceAsString(), E_USER_WARNING);
return false;
}
$this->SendDebug('SoapFault', $Result->getMessage(), 0);
Expand Down

0 comments on commit 3575fa9

Please sign in to comment.