File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed
components/ChallengeEditor/Description-Field Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -782,7 +782,11 @@ class DescriptionField extends Component {
782
782
} ) . then ( res => {
783
783
onload ( res )
784
784
} ) . catch ( err => {
785
- console . log ( 'An unexpected error occured while uploading image' )
785
+ if ( process . env . NODE_ENV === 'development' ) {
786
+ console . log ( err )
787
+ } else {
788
+ console . log ( 'An unexpected error occured while uploading image' )
789
+ }
786
790
onerror ( )
787
791
} )
788
792
}
Original file line number Diff line number Diff line change @@ -94,7 +94,11 @@ class Routes extends React.Component {
94
94
getFreshToken ( ) . then ( ( token ) => {
95
95
this . props . saveToken ( token )
96
96
} ) . catch ( ( error ) => {
97
- console . error ( 'An unexpected error occurred while getting auth token' )
97
+ if ( process . env . NODE_ENV === 'development' ) {
98
+ console . error ( error )
99
+ } else {
100
+ console . error ( 'An unexpected error occurred while getting auth token' )
101
+ }
98
102
const redirectBackToUrl = window . location . origin + this . props . location . pathname
99
103
window . location = ACCOUNTS_APP_LOGIN_URL + '?retUrl=' + redirectBackToUrl
100
104
} )
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export const getToken = () => {
18
18
resolve ( token )
19
19
} )
20
20
. catch ( ( err ) => {
21
- console . error ( 'Error getting auth token' )
21
+ if ( process . env . NODE_ENV === 'development' ) {
22
+ console . log ( err )
23
+ } else {
24
+ console . error ( 'Error getting auth token' )
25
+ }
22
26
reject ( err )
23
27
} )
24
28
}
@@ -40,7 +44,11 @@ axiosInstance.interceptors.request.use(config => {
40
44
return config
41
45
} )
42
46
. catch ( ( err ) => {
43
- console . error ( 'An unexpected error occured while retrieving the auth token.' )
47
+ if ( process . env . NODE_ENV === 'development' ) {
48
+ console . log ( err )
49
+ } else {
50
+ console . error ( 'An unexpected error occured while retrieving the auth token.' )
51
+ }
44
52
const redirectBackToUrl = window . location . origin
45
53
window . location = ACCOUNTS_APP_LOGIN_URL + '?retUrl=' + redirectBackToUrl
46
54
} )
You can’t perform that action at this time.
0 commit comments