Error handling 在客户端消除错误
我的堆栈react/redux/redux observable/immutablejs。 客户端由feathers.js使用服务器端渲染进行渲染。 我使用feather客户端,在获得400之后(请求未通过验证)。 我得到了一个.json格式的响应。但由于某些原因,它被转换为HTML或字符串Error handling 在客户端消除错误,error-handling,feathersjs,feather,Error Handling,Feathersjs,Feather,我的堆栈react/redux/redux observable/immutablejs。 客户端由feathers.js使用服务器端渲染进行渲染。 我使用feather客户端,在获得400之后(请求未通过验证)。 我得到了一个.json格式的响应。但由于某些原因,它被转换为HTML或字符串 Error: Order validation failed at BadRequest.ExtendableBuiltin (bundle.js:106696) at BadRequest
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;
花上几分钟来修复它,它只是implement.toJSON()方法…是的,在客户端上会出现错误。JavaScript不像控制台上的普通对象那样记录日志。您仍然可以访问所有属性,但它们不会显示在
控制台.log
中。如果你想把它记录下来,。toJSON
是最好的选择。