Skip to content

Commit

Permalink
use logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Gil Teitelbaum committed Sep 17, 2020
1 parent fbe9178 commit d9871bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/restService.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from 'axios';
import { toast } from 'react-toastify';
import logger from "./loggerService";

axios.interceptors.response.use(null, error => {
if (!error.response || error.response.status < 400 || error.response.status >= 500) {
console.log("Error getting movies from server - " + error);
logger.error("Error getting movies from server - " + error);
toast.error("an unexpected error happened");
}
return Promise.reject(error);
Expand Down

0 comments on commit d9871bd

Please sign in to comment.