mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
30 lines
910 B
JavaScript
Executable File
30 lines
910 B
JavaScript
Executable File
angular.module('app')
|
|
.controller('ErrorController', ['$window', '$rootScope', '$scope', '$stateParams', '$location', function($window, $rootScope, $scope, $p, $location) {
|
|
$rootScope.title = 'Error';
|
|
$scope.path = $location.path();
|
|
$scope.type = $p.type || 'unknown';
|
|
$scope.browser = $window.navigator.userAgent;
|
|
|
|
switch ($scope.type) {
|
|
case 404:
|
|
$scope.msgPre = 'Page';
|
|
$scope.msgHighlight = $scope.path;
|
|
$scope.msgPost = 'Not Found';
|
|
break;
|
|
case 'no-ship':
|
|
$scope.msgPre = 'Ship';
|
|
$scope.msgHighlight = $p.message;
|
|
$scope.msgPost = 'does not exist';
|
|
break;
|
|
case 'build-fail':
|
|
$scope.msgPre = 'Build Failure!';
|
|
$scope.details = $p.details;
|
|
break;
|
|
default:
|
|
$scope.msgPre = 'Uh, Jameson, we have a problem..';
|
|
$scope.errorMessage = $p.message;
|
|
$scope.details = $p.details;
|
|
}
|
|
|
|
}]);
|