Skip to content

Add option to exclude timestamp from callRestAPI() exception messages #149

@filiptorphage-mjuk

Description

@filiptorphage-mjuk

Hi,

callRestAPI() can be configured to throw an exception when an error occurs. Would it be possible to add an option to exclude the timestamp from the exception message?

We use Sentry for error monitoring, and including the timestamp prevents proper grouping because each exception message becomes unique.

I understand the timestamp may be useful to existing users, so keeping the current behavior as the default and making the timestamp optional would probably avoid breaking changes.

Relevant code:

}
}
if ($description !== '') {
$description = date('Y-m-d H:i:s ') . "{$description}";
$description .= "[URL({$this->method}): {$this->url}]";
if ($errorCode !== 401) {
throw new Exception($description, $errorCode);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions