I know the difference between a callback and a middleware next() function.
If a write a custom remote-method in Loopback, I can easily send errors in callback e.g callback(error,null) but in remote hooks or observers whenever I send error in next() function e.g
var err = new Error('This is error');
next(err)
it always says that Internal server error but it does not tell me what error is. In order to view error I have to login to server and view logs. Please tell me how can I send error as a response in next() function so that the on frontend I know what error has occurred.