Skip to content

Commit

Permalink
Release 1.23 - log2file bug - error 500
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardnico committed Jan 17, 2022
1 parent 2fea41f commit 8acada9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ComboStrap/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ public function send($payload = null, $contentType = null)
* Exit
*/
if (!PluginUtility::isTest()) {
if (Http::getStatus() !== self::STATUS_ALL_GOOD) {
LogUtility::log2file($this->msg, LogUtility::LVL_MSG_ERROR, $this->canonical);
if ($this->status !== self::STATUS_ALL_GOOD && $this->msg !== null) {
// if this is a 304, there is no body, no message
LogUtility::log2file("Bad Http Response: $this->status : $this->msg", LogUtility::LVL_MSG_ERROR, $this->canonical);
}
exit;
} else {
Expand Down
2 changes: 1 addition & 1 deletion ComboStrap/LogUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private static function messageNotEmpty(?string $message)
$newMessage = "The passed message to the log was empty or null. BackTrace: \n";
ob_start();
$limit = 10;
debug_print_backtrace(0, $limit);
debug_print_backtrace(0, $limit); // It prints also the data passed :)
$trace = ob_get_contents();
ob_end_clean();
$newMessage .= $trace;
Expand Down

0 comments on commit 8acada9

Please sign in to comment.