Skip to content

Conversation

@emanuelmetal
Copy link
Member

@emanuelmetal emanuelmetal commented Jul 30, 2018

Background

We need to improve Error handling in the app by using a react error boundary component and, an error middlware to log each filed request.

Changes done

  • Added ErrorBoundary component
  • Added Error Middleware for redux


export function fetchUsers(params = {}) {
return axios.get(DEFAULT_API_USERS_ENDPOINT, { params });
return axios.get(DEFAULT_API_USERS_ENDPOINT + 'asd', { params });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the 'asd'

// <App />,
// document.getElementById('root')
// );
//
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code

@@ -0,0 +1,9 @@
// eslint-disable-next-line no-unused-vars
const errorsMiddleware = store => next => action => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review unused vars

export function logErrors(message, file, line = 'N/A', col = 'N/A') {
Logger.error(`An Error Occurred!!: message[${message}], file[${file}], line[${line}], col[${col}]`);
export function logErrors(error) {
// Logger.error(`An Error Occurred!!: message[${message}], file[${file}], line[${line}], col[${col}]`);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comented code

@emanuelmetal emanuelmetal self-assigned this Jul 31, 2018
@emanuelmetal emanuelmetal added the enhancement New feature or request label Jul 31, 2018
@emanuelmetal emanuelmetal added Feature A new feature/functionality/improvement and removed enhancement New feature or request labels Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature A new feature/functionality/improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants