Commit b6e5ab46 by Vishal Kadam

Added error handling for search

parent 582c2294
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
var git = require('git-rev'); var git = require('git-rev');
module.exports = function (grunt) { module.exports = function(grunt) {
var classPathSep = (process.platform === "win32") ? ';' : ':', var classPathSep = (process.platform === "win32") ? ';' : ':',
gitHash = '', gitHash = '',
pkg = grunt.file.readJSON('package.json'); pkg = grunt.file.readJSON('package.json');
...@@ -114,7 +114,7 @@ module.exports = function (grunt) { ...@@ -114,7 +114,7 @@ module.exports = function (grunt) {
compress: { compress: {
release: { release: {
options: { options: {
archive: function () { archive: function() {
return [pkg.name, pkg.version, gitHash].join('_') + '.tgz'; return [pkg.name, pkg.version, gitHash].join('_') + '.tgz';
} }
}, },
...@@ -131,16 +131,16 @@ module.exports = function (grunt) { ...@@ -131,16 +131,16 @@ module.exports = function (grunt) {
grunt.registerTask('server:prod', ['nodemon:prod']); grunt.registerTask('server:prod', ['nodemon:prod']);
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(); var done = this.async();
grunt.file.mkdir('public/dist'); grunt.file.mkdir('public/dist');
grunt.task.run(['shell:min']); grunt.task.run(['shell:min']);
done(); done();
}); });
grunt.registerTask('release', 'Create release package', function () { grunt.registerTask('release', 'Create release package', function() {
var done = this.async(); var done = this.async();
git.short(function (str) { git.short(function(str) {
gitHash = str; gitHash = str;
grunt.task.run(['minify', 'compress:release']); grunt.task.run(['minify', 'compress:release']);
done(); 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)"> <alert data-ng-repeat="notification in getNotifications()" data-type="{{notification.type}}" data-close="close(notification)">
{{notification.message}} {{notification.message}}
</alert> </alert>
......
...@@ -8,7 +8,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio ...@@ -8,7 +8,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope.search = function(query) { $scope.search = function(query) {
$scope.results = []; $scope.results = [];
NotificationService.reset(); NotificationService.reset();
SearchResource.search($location.search(query).search(), function(response) { SearchResource.search($location.search(query).search(), function searchSuccess(response) {
$scope.results = response; $scope.results = response;
if ($scope.results.length < 1) { if ($scope.results.length < 1) {
NotificationService.error('No Result found', false); NotificationService.error('No Result found', false);
...@@ -16,6 +16,8 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio ...@@ -16,6 +16,8 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$state.go('search.results', {}, { $state.go('search.results', {}, {
location: false 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