Skip to content

Reporting a RequestException in a try catch block does not log an error #57846

@bsterckx

Description

@bsterckx

Laravel Version

12.39.0

PHP Version

8.3.26

Database Driver & Version

Mariadb 10.11

Description

When a caught RequestException gets reported in a try catch block via the report($e) function no error gets logged. The issue is not there in 12.37.0 but is there in v12.38.1 & v12.39.0. This was caught because of a failing test and seems like a small backwards incompatible change.

Steps To Reproduce

it('can report a caught request exception', function () {
    Http::fake([
        'https://test.example.com/fake-endpoint' => Http::response('test', 500),
    ]);

    Log::shouldReceive('error')->once();

    try{
        Http::get('https://test.example.com/fake-endpoint')->throw();
    } catch(RequestException $e){
        // do something
        report($e);
    }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions