api/http/builders/EndpointBuilder.js
/**
		 * Adds a {@link ErrorInterceptor} for handling remote web service errors.
		 *
		 * @public
		 * @param {ErrorInterceptor} responseInterceptor
		 * @returns {EndpointBuilder}
		 */
Adds a  ErrorInterceptor for handling remote web service errors.
Adds a ErrorInterceptor for handling remote web service errors .
withErrorInterceptor(errorInterceptor) {
			assert.argumentIsRequired(errorInterceptor, 'errorInterceptor', ErrorInterceptor, 'ErrorInterceptor');
			let existingErrorInterceptor = this.endpoint.errorInterceptor;
			let updatedErrorInterceptor;
			if (existingErrorInterceptor && existingErrorInterceptor !== ErrorInterceptor.EMPTY) {
				updatedErrorInterceptor = new CompositeErrorInterceptor(existingErrorInterceptor, errorInterceptor);
			} else {
				updatedErrorInterceptor = errorInterceptor;
			}
			this._endpoint = new Endpoint(this.endpoint.name, this.endpoint.description, this.endpoint.verb, this.endpoint.protocol, this.endpoint.host, this.endpoint.port, this.endpoint.path, this.endpoint.query, this.endpoint.headers, this.endpoint.body, this.endpoint.credentials, this.endpoint.requestInterceptor, this.endpoint.responseInterceptor, updatedErrorInterceptor);
			return this;
		}
withErrorInterceptor ( errorInterceptor ) { assert . argumentIsRequired ( errorInterceptor , 'errorInterceptor' , ErrorInterceptor , 'ErrorInterceptor' ) ; let existingErrorInterceptor = this . endpoint . errorInterceptor ; let updatedErrorInterceptor ; if ( existingErrorInterceptor && existingErrorInterceptor !== ErrorInterceptor . EMPTY ) { updatedErrorInterceptor = new CompositeErrorInterceptor ( existingErrorInterceptor , errorInterceptor ) ; } else { updatedErrorInterceptor = errorInterceptor ; } this . _endpoint = new Endpoint ( this . endpoint . name , this . endpoint . description , this . endpoint . verb , this . endpoint . protocol , this . endpoint . host , this . endpoint . port , this . endpoint . path , this . endpoint . query , this . endpoint . headers , this . endpoint . body , this . endpoint . credentials , this . endpoint . requestInterceptor , this . endpoint . responseInterceptor , updatedErrorInterceptor ) ; return this ; }
Adds a {@link ErrorInterceptor} for handling remote web service errors.
Adds a { @link ErrorInterceptor } for handling remote web service errors .