在客户端出现错误

时间:2017-03-11 15:51:28

标签: error-handling feathersjs feather

我的堆栈反应/ redux / redux-observable / immutablejs。 客户端使用服务器端呈现由feathers.js呈现。 获得400后,我使用feather-client(请求没有通过验证)。 我收到了.json格式的回复。但由于某些原因,它被转换为HTML或字符串。

Error: Order validation failed
    at BadRequest.ExtendableBuiltin (bundle.js:106696)
    at BadRequest.FeathersError (bundle.js:106771)
    at new BadRequest (bundle.js:106812)
    at convert (bundle.js:107040)
    at toError (bundle.js:106043) 

如何在客户端禁用它?

import 'isomorphic-fetch';
import feathers from 'feathers-client';
import authentication from 'feathers-authentication-client';
import config from './config';

let storage = null;
if (!process.env.BROWSER && process.NODE_ENV !== 'test') {
  require('localstorage-polyfill');
  storage = global.localStorage;
}else{
  storage = window.localStorage;
}

const port = process.env.PORT || config.port;

promise.polyfill();

const rest = feathers.rest(`http://localhost:${port}/api`);
const app = feathers()
  .configure(feathers.hooks())
  .configure(rest.fetch(require('isomorphic-fetch')))
  .configure(authentication({ storage }));

export default app;

1 个答案:

答案 0 :(得分:0)

花一些时间修复它,它只是实现.toJSON()方法......

相关问题