Contact/platform/services/http-error-interceptor.js
/**
	 * This function handles error messages force by the backend server.
	 * The error will be forwarded as Platform message 'onHttpError' containing error data
	 * @param rejection
	 * @returns {Promise}
	 */
This function handles error messages force by the backend server.
The error will be forwarded as Platform message 'onHttpError' containing error data
@param rejection
@returns {Promise}
This function handles error messages force by the backend server . The error will be forwarded as Platform message ' onHttpError ' containing error data @param rejection @returns { Promise }
function responseError(rejection) {
		if (rejection.status !== 401) {  
			if (rejection && rejection.config && rejection.config.url) {
				if (rejection.config.url.indexOf('/i18n/') === -1) {
					if (rejection.config.headers.errorDialog === undefined || rejection.config.headers.errorDialog === true) {
						service.onHttpError.fire('platform.$http.error', rejection);
					}
				} else {
					var match = rejection.config.url.match(/(.+i18n\/.{2,3})-.{2,3}\.json$/);
					if (match) {
						rejection.config.url = match[1] + '.json';
						return $injector.get('$http')(rejection.config);
					} else {
						return $injector.get('$http').get(globals.appBaseUrl + 'common/content/i18n/empty.json');
					}
				}
			}
		}
		return $q.reject(rejection);
	}
function responseError ( rejection ) { if ( rejection . status !== 401 ) { if ( rejection && rejection . config && rejection . config . url ) { if ( rejection . config . url . indexOf ( '/i18n/' ) === - 1 ) { if ( rejection . config . headers . errorDialog === undefined || rejection . config . headers . errorDialog === true ) { service . onHttpError . fire ( 'platform.$http.error' , rejection ) ; } } else { var match = rejection . config . url . match ( / (.+i18n\/.{2,3})-.{2,3}\.json$ / ) ; if ( match ) { rejection . config . url = match [ 1 ] + '.json' ; return $injector . get ( '$http' ) ( rejection . config ) ; } else { return $injector . get ( '$http' ) . get ( globals . appBaseUrl + 'common/content/i18n/empty.json' ) ; } } } } return $q . reject ( rejection ) ; }
This function handles error messages force by the backend server.
This function handles error messages force by the backend server .
// authentication error handle by autothentication library // supress fire error event for i18n json files