Git Product home page Git Product logo

Comments (3)

v1p avatar v1p commented on August 22, 2024

@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.
the middleware/index.js is configured as documented :

'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 signup(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 feathers-errors object. It's always a stacktrace, saying validation failed & I have gone over the documentation looking for any specific error handling configuration with respect to socketio.

Please suggest if I am missing something obvious to make it work.

from socketio.

daffl avatar daffl commented on August 22, 2024

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 feathers-errors Error object? It normally doesn't give much away by just using console.log, you will have to call err.toJSON to see all properties.

from socketio.

v1p avatar v1p commented on August 22, 2024

@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

from socketio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.