Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 5266811b

Přidáno uživatelem Pavel Fidranský před téměř 6 roky(ů)

improved error handling - alert is displayed and error is logged in console

Zobrazit rozdíly:

sources/src/main/webapp/js/components/header.js
83 83
			document.body.classList.add('loggedOut');
84 84

  
85 85
		} catch (error) {
86
			alert('Something went wrong. Check console for more details.');
87 86
			console.error(error);
88
	}
87
			alert('Something went wrong. Check console for more details.');
88
		}
89 89
	}
90 90
}
sources/src/main/webapp/js/components/loginPopup.js
106 106
						alert('Invalid credentials.');
107 107
						break;
108 108
					default:
109
						alert('Something went wrong.');
109
						console.error(error);
110
						alert('Something went wrong. Check console for more details.');
110 111
				}
111 112
			} else {
112
				alert('Something went wrong. Check console for more details.');
113 113
				console.error(error);
114
				alert('Something went wrong. Check console for more details.');
114 115
			}
115 116
		}
116 117
	}
sources/src/main/webapp/js/components/registerPopup.js
148 148
						this._printErrors(error.response);
149 149
						break;
150 150
					default:
151
						alert('Something went wrong.');
151
						console.error(error);
152
						alert('Something went wrong. Check console for more details.');
152 153
				}
153 154
			} else {
154
				alert('Something went wrong. Check console for more details.');
155 155
				console.error(error);
156
				alert('Something went wrong. Check console for more details.');
156 157
			}
157 158
		}
158 159
	}
sources/src/main/webapp/js/components/saveDiagramModalWindow.js
120 120
						alert('You are either not logged in or not an owner of this diagram.');
121 121
						break;
122 122
					default:
123
						alert('Something went wrong.');
123
						console.error(error);
124
						alert('Something went wrong. Check console for more details.');
124 125
				}
125 126
			} else {
126
				alert('Something went wrong. Check console for more details.');
127 127
				console.error(error);
128
				alert('Something went wrong. Check console for more details.');
128 129
			}
129 130
		}
130 131
	}
sources/src/main/webapp/js/showGraphApp.js
175 175
						alert('You are not allowed to view the diagram.');
176 176
						break;
177 177
					default:
178
						alert('Something went wrong.');
178
						console.error(error);
179
						alert('Something went wrong. Check console for more details.');
179 180
				}
180 181
			} else {
181
				alert('Something went wrong. Check console for more details.');
182 182
				console.error(error);
183
				alert('Something went wrong. Check console for more details.');
183 184
			}
184 185

  
185 186
			// go to the upload page
sources/src/main/webapp/js/uploadFilesApp.js
65 65
			document.body.classList.add('loggedOut');
66 66

  
67 67
		} catch (error) {
68
			if (error instanceof HttpError) {
69
				alert('Something went wrong.');
70
			} else {
71
				alert('Something went wrong. Check console for more details.');
72
				console.error(error);
73
			}
68
			console.error(error);
69
			alert('Something went wrong. Check console for more details.');
74 70
		}
75 71
	}
76 72

  
......
102 98
			});
103 99

  
104 100
		} catch (error) {
105
			if (error instanceof HttpError) {
106
				alert('Something went wrong.');
107
			} else {
108
				alert('Something went wrong. Check console for more details.');
109
				console.error(error);
110
			}
101
			console.error(error);
102
			alert('Something went wrong. Check console for more details.');
111 103
		}
112 104
	}
113 105

  
......
131 123
							alert('You are either not logged in or not an owner of this diagram.');
132 124
							break;
133 125
						default:
134
							alert('Something went wrong.');
126
							console.error(error);
127
							alert('Something went wrong. Check console for more details.');
135 128
					}
136 129
				} else {
137
					alert('Something went wrong. Check console for more details.');
138 130
					console.error(error);
131
					alert('Something went wrong. Check console for more details.');
139 132
				}
140 133
			}
141 134
		}

Také k dispozici: Unified diff