I constantly have this error Possibly unhandled rejection even when using
$promise.then(success, err) or $promise.then(success).catch(err)
What should I do to fix this error. Thanks
this is the code
this.User = $injector.get('User');
this.User.get(id).$promise
.then(fn, fn)
in the User resource:
class UserResource {
    constructor($resource) {
        'ngInject';
        this.$resource = $resource;
    }
    get(id) {
        return this.$resource(apis.user + id).get();
    }
}
 
    