Commit 74f6f591 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

somewhat more fancy errors

parent 8aa24ead
Loading
Loading
Loading
Loading
+8 −21
Original line number Diff line number Diff line
@@ -448,31 +448,18 @@ div.about a {
	text-decoration: none;
}

div.error {
	font-size: 150%;
	font-weight: bold;
	color: #ee0000;
}

div.candidatelist div.error {
	font-size: 110%;
	color: #000000;
	font-weight: normal;
	padding:3px 6px 2px 6px;
	-webkit-border-radius: 30px;
	-moz-border-radius: 30px;
	border-radius: 30px;
	border-color: #ee0000;
	border-width: 1px;
	border-style: solid;
	background-color: #ffeeee;
	margin-top: 0.3em;
.error {
	padding: 15px;
	margin-bottom: 20px;
	border: 1px solid #ebccd1;
	border-radius: 4px;
	color: #a94442;
	background-color: #f2dede;
	margin-left: auto;
	margin-right: auto;
	max-width: 25em;
}

div.candidatelist div.errshort {
.error .errcode {
	font-family: Monospace;
	margin-top: 2em;
	font-size: 100%;
+16 −12
Original line number Diff line number Diff line
@@ -2,15 +2,19 @@ $(document).ready(function() {
	var removeStatus = function() {
		$('div.candidatestatus').remove();
	};
	var showError = function(oneline, str) {
	var showError = function(header, message, code) {
		var errnode = $(document.createElement('div'));
		errnode.attr('class', 'error');
		errnode.text(str);
		errnode.text(message);

		if (oneline) {
		var headnode = $(document.createElement('strong'));
		headnode.text(header);
		errnode.prepend(headnode);

		if (code) {
			var shortnode = $(document.createElement('div'));
			shortnode.attr('class', 'errshort');
			shortnode.text(oneline);
			shortnode.attr('class', 'errcode');
			shortnode.text(code);
			errnode.append(shortnode);
		}

@@ -20,9 +24,9 @@ $(document).ready(function() {
	var processResult = function(data) {
		removeStatus();
		if (data.error) {
			showError('Backend-Fehler', data.error);
			showError('Backend-Fehler:', data.error, null);
		} else if (data.candidates.length == 0) {
			showError(null, 'Keine Bahnhöfe in 70km Umkreis gefunden');
			showError('Keine Bahnhöfe in 70km Umkreis gefunden', '', null);
		} else {
			$.each(data.candidates, function(i, candidate) {

@@ -53,13 +57,13 @@ $(document).ready(function() {
	var processError = function(error) {
		removeStatus();
		if (error.code == error.PERMISSION_DENIED) {
			showError('geolocation.error.PERMISSION_DENIED', 'Standortanfrage nicht möglich. Vermutlich fehlen die Rechte im Browser oder der Android Location Service ist deaktiviert.');
			showError('Standortanfrage nicht möglich.', 'Vermutlich fehlen die Rechte im Browser oder der Android Location Service ist deaktiviert.', 'geolocation.error.PERMISSION_DENIED');
		} else if (error.code == error.POSITION_UNAVAILABLE) {
			showError('geolocation.error.POSITION_UNAVAILABLE', 'Standort konnte nicht ermittelt werden (Service nicht verfügbar)');
			showError('Standort konnte nicht ermittelt werden', '(Service nicht verfügbar)', 'geolocation.error.POSITION_UNAVAILABLE');
		} else if (error.code == error.TIMEOUT) {
			showError('geolocation.error.TIMEOUT', 'Standort konnte nicht ermittelt werden (Timeout)');
			showError('Standort konnte nicht ermittelt werden', '(Timeout)', 'geolocation.error.TIMEOUT');
		} else {
			showError('unknown geolocatior.error code', 'Standort konnte nicht ermittelt werden (unbekannter Fehler)');
			showError('Standort konnte nicht ermittelt werden', '(unbekannter Fehler)', 'unknown geolocation.error code');
		}
	};

@@ -68,6 +72,6 @@ $(document).ready(function() {
		$('div.candidatestatus').text('Position wird bestimmt…');
	} else {
		removeStatus();
		showError(null, 'Standortanfragen werden von diesem Browser nicht unterstützt');
		showError('Standortanfragen werden von diesem Browser nicht unterstützt', '', null);
	}
});
+4 −6
Original line number Diff line number Diff line
<div class="error">500 Internal Server Error</div>
<div>
<pre>
Beim Bearbeiten der Anfrage ist ein Fehler aufgetreten.

An error occured while processing your request.
<div class="error">
<strong>500 Internal Server Error:</strong>
Beim Bearbeiten der Anfrage ist ein Fehler aufgetreten.<br/>

<pre>
----------[Debug start]----------
%= $exception->message
Stash:
+2 −2
Original line number Diff line number Diff line
@@ -39,8 +39,8 @@
</div>
% }
% elsif (stash('stationlist')) {
<div class="error">Mehrdeutige Eingabe</div>
<div>Bitte eine Station aus der Liste auswählen</div>
<div class="error"><strong>Mehrdeutige Eingabe.</strong>
Bitte eine Station aus der Liste auswählen</div>
% }
</div>

+4 −6
Original line number Diff line number Diff line
<div class="error">404 Page Not Found</div>
<div>
<pre>
<div class="container">
<div class="error">
<strong>404 Page Not Found:</strong>
Die aufgerufene URL existiert nicht und ist keine gültige Abbildung auf einen
Bahnhofsnamen.

The requested URL does not exist and does not map to a train station.
</pre>
</div>
</div>