Skip to content

Add error in callback #11

@TakeshiDaveau

Description

@TakeshiDaveau

Hi,

I was watching in your code to check if it was possible to be informed when the slack api answer with an error, but it's not possible

function executeGetRequest(url, callback) {
            $http.get(url).
              success(function (result) {
                  if (callback)
                      callback(result);
              }).
              error(function (data, status) {
                  $log.log(status);
                  $log.log(data);
              });
        } 

Is it possible to get an error in the callback ?
Exemple :

function executeGetRequest(url, callback) {
            $http.get(url).
              success(function (result) {
                  if (callback)
                      callback(result);
              }).
              error(function (data, status) {
                  if (callback)
                      callback(null, status);
                  $log.log(status);
                  $log.log(data);
              });
        } 

Or something like that ?

Thanks in advance

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