Commit b6e5ab46 by Vishal Kadam

Added error handling for search

parent 582c2294
......@@ -2,7 +2,7 @@
var git = require('git-rev');
module.exports = function (grunt) {
module.exports = function(grunt) {
var classPathSep = (process.platform === "win32") ? ';' : ':',
gitHash = '',
pkg = grunt.file.readJSON('package.json');
......@@ -92,16 +92,16 @@ module.exports = function (grunt) {
shell: {
min: {
command: 'java ' +
'-cp public/lib/closure-compiler/compiler.jar' + classPathSep +
'public/lib/ng-closure-runner/ngcompiler.jar ' +
'org.angularjs.closurerunner.NgClosureRunner ' +
'--compilation_level SIMPLE_OPTIMIZATIONS ' +
'-cp public/lib/closure-compiler/compiler.jar' + classPathSep +
'public/lib/ng-closure-runner/ngcompiler.jar ' +
'org.angularjs.closurerunner.NgClosureRunner ' +
'--compilation_level SIMPLE_OPTIMIZATIONS ' +
//'--formatting PRETTY_PRINT ' +
'--language_in ECMASCRIPT5_STRICT ' +
'--angular_pass ' +
'--manage_closure_dependencies ' +
'--js <%= modules %> ' +
'--js_output_file <%= dist %>'
'--language_in ECMASCRIPT5_STRICT ' +
'--angular_pass ' +
'--manage_closure_dependencies ' +
'--js <%= modules %> ' +
'--js_output_file <%= dist %>'
}
},
devUpdate: {
......@@ -114,7 +114,7 @@ module.exports = function (grunt) {
compress: {
release: {
options: {
archive: function () {
archive: function() {
return [pkg.name, pkg.version, gitHash].join('_') + '.tgz';
}
},
......@@ -131,16 +131,16 @@ module.exports = function (grunt) {
grunt.registerTask('server:prod', ['nodemon:prod']);
grunt.registerTask('server:prod', ['nodemon:prod']);
grunt.registerTask('minify', 'Minify the all js', function () {
grunt.registerTask('minify', 'Minify the all js', function() {
var done = this.async();
grunt.file.mkdir('public/dist');
grunt.task.run(['shell:min']);
done();
});
grunt.registerTask('release', 'Create release package', function () {
grunt.registerTask('release', 'Create release package', function() {
var done = this.async();
git.short(function (str) {
git.short(function(str) {
gitHash = str;
grunt.task.run(['minify', 'compress:release']);
done();
......
<div data-ng-controller="NotificationController">
<div class="container" data-ng-controller="NotificationController">
<alert data-ng-repeat="notification in getNotifications()" data-type="{{notification.type}}" data-close="close(notification)">
{{notification.message}}
</alert>
......
......@@ -8,7 +8,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope.search = function(query) {
$scope.results = [];
NotificationService.reset();
SearchResource.search($location.search(query).search(), function(response) {
SearchResource.search($location.search(query).search(), function searchSuccess(response) {
$scope.results = response;
if ($scope.results.length < 1) {
NotificationService.error('No Result found', false);
......@@ -16,6 +16,8 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$state.go('search.results', {}, {
location: false
});
}, function searchError(err) {
NotificationService.error('Error occurred during executing search query, error status code = ' + err.status + ', status text = ' + err.statusText, false);
});
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment