Skip to content

The rescue function is not in the composer dependencies #107

Open
@vdauchy

Description

@vdauchy

Hi,

It looks like the rescue function used in AutomaticDateFormatWithMillisecondsand in AutomaticDateFormat is not part of the dependencies.
It seem to be only in the framwork package:

https://github.com/laravel/framework/blob/46ac7829eba556031fa5f540f3771d52fa4117a2/src/Illuminate/Foundation/helpers.php#L766

To solve the issue in my package I added:

    function rescue(callable $callback, $rescue = null, $report = true)
    {
        try {
            return $callback();
        } catch (Throwable $e) {
            if (value($report, $e) && function_exists('report')) {
                report($e);
            }

            return value($rescue, $e);
        }
    }

However would you be interested to add this to your package ? Or remove the use of rescue ? Or be fine with the current state :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions