Question: I'm trying to create a service that livestreams my webcam on the web. Should i use Red5 or trying to set it up on my own with WebRTC and getUserMedia? If yes, how? Any kind of tip is accepted! Thanks in advance

Answer: 
Ok thanks to @pathurs and @Hendry I got what I needed.

First of all, the right way is what @Hendry suggested which was to not handle the catch in the wrapper, rather in the function call. This is the way I went:

```
function requestWrapper(url) {
    return request(url)
        .then(data => {...})
}
requestWrapper('http://some-url.com')
    .then(data => {...})
    .catch(err => console.log(err));

```

Great!
But apparently, @pathurs way also works:

```
function requestWrapper(url) {
        return request(url)
            .then(data => {...})
            .catch(err => Promise.reject(err));
    }
    requestWrapper('http://some-url.com')
        .then(data => {...}, err => console.log(err));

```

I don't understand if that's a native feature, or some addition to `request` library:
<https://github.com/request/request-promise#thenonfulfilled-onrejected>
if you are not getting that then do this workaround.

In order to handle rejections the following new events will be fired on `process`:

### Event 'unhandledRejection':

Emitted whenever a possibly unhandled rejection is detected.
This event is emitted with the following arguments:

reason the rejection `reason` of the promise susprected in having an unhandled rejection
`p` the promise suspected in having an unhandled rejection itself.

```
process.on('unhandledRejection', function(reason, p){
    console.log("Possibly Unhandled Rejection at: Promise ", p, " reason: ", reason);
    // application specific logging here
});

```

For more info [Unhandled Rejection](https://gist.github.com/benjamingr/0237932cee84712951a2)