Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Success and error callbacks #62

Open
helsont opened this issue Jun 27, 2016 · 3 comments
Open

Success and error callbacks #62

helsont opened this issue Jun 27, 2016 · 3 comments

Comments

@helsont
Copy link

helsont commented Jun 27, 2016

This is especially important if an error has occurred, which happens frequently when the correct channel is not specified. Right now the error is just thrown, but an error callback would be a much more graceful way of handling it.

@soullivaneuh
Copy link

Could you please provide a concrete use case?

Why a try catch would not be sufficient?

@newelement
Copy link

When sending a message fails it's causing laravel queues to fail even when using try catch.

@duyemura
Copy link

I'm seeing the same thing - unless I'm implementing incorrectly.

`$settings = [
'username' => 'XYZ',
'channel' => '#' .$integration['slack_notification_channel'],
'link_names' => true,
'unfurl_links' => true,
'unfurl_media' => true
];

        $slack = new Maknz\Slack\Client('this-isnot-a-valid-webhook-url', $settings);

        $copy = "testing your settings.  If you see this message, everything is good to go!";
            try {
                $test = $slack->send($copy);

            }
            catch (Exception $e) { 
                 echo $e->getMessage();
                die("ERROR");
            }
        }

`

This code will seem to work without throwing an error and catching....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants