-
Notifications
You must be signed in to change notification settings - Fork 14
Client should convert error objects to feathers-errors #30
Comments
@daffl Hey David! Just curious if this bug was actually solved. I am using feathers auk release, have a generated backend service i.e. default generated app. 'use strict';
const handler = require('feathers-errors/handler');
const notFound = require('./not-found-handler');
const logger = require('./logger');
module.exports = function() {
// Add your custom middleware here. Remember, that
// just like Express the order matters, so error
// handling middleware should go last.
const app = this;
app.use(notFound());
app.use(logger(app));
app.use(handler());
}; In the client I am working with React & have configured feathers-client as documented : import io from 'socket.io-client';
import feathers from 'feathers-client';
import rx from 'feathers-reactive';
import RxJS from 'rxjs';
const apiHost = "ws://localhost:3030";
const socket = io(apiHost);
export const app = feathers()
.configure(feathers.socketio(socket))
.configure(rx(RxJS))
.configure(feathers.hooks())
.configure(feathers.authentication({ storage: window.localStorage })); This is how I am calling a service export function #(app, email, password) {
const users = app.service('users');
return users.create({email, password})
.then((data, err) => data)
.catch((err) => {
console.log(err);
return;
});
} The error is never a Please suggest if I am missing something obvious to make it work. |
It should be. Error conversion is happening i https://github.com/feathersjs/feathers-socket-commons/blob/master/src/client.js#L77 using https://github.com/feathersjs/feathers-errors/blob/master/src/index.js#L206. How do you know it is not a |
@daffl My bad. Thanks for the info, I guess I was hitting some other problem when I was trying to access err.errors & it was throwing undefined, but might for a different reason altogether |
No description provided.
The text was updated successfully, but these errors were encountered: