Java Code Examples for feign.codec.ErrorDecoder#Default

The following examples show how to use feign.codec.ErrorDecoder#Default . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompensableFeignErrorDecoder.java    From ByteTCC with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void invokeAfterPropertiesSet() throws Exception {
	feign.codec.ErrorDecoder errorDecoder = null;

	String[] beanNameArray = this.applicationContext.getBeanNamesForType(feign.codec.ErrorDecoder.class);
	for (int i = 0; beanNameArray != null && i < beanNameArray.length; i++) {
		String beanName = beanNameArray[i];
		Object beanInst = this.applicationContext.getBean(beanName);
		if (CompensableFeignErrorDecoder.class.isInstance(beanInst)) {
			continue;
		} else if (errorDecoder != null) {
			throw new RuntimeException("There are more than one feign.codec.ErrorDecoder exists!");
		} else {
			errorDecoder = (feign.codec.ErrorDecoder) beanInst;
		}
	}

	if (errorDecoder == null) {
		errorDecoder = new ErrorDecoder.Default();
	} // end-if (errorDecoder == null)

	this.delegate = errorDecoder;
}
 
Example 2
Source File: TransactionFeignErrorDecoder.java    From ByteJTA with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void invokeAfterPropertiesSet() throws Exception {
	feign.codec.ErrorDecoder errorDecoder = null;

	String[] beanNameArray = this.applicationContext.getBeanNamesForType(feign.codec.ErrorDecoder.class);
	for (int i = 0; beanNameArray != null && i < beanNameArray.length; i++) {
		String beanName = beanNameArray[i];
		Object beanInst = this.applicationContext.getBean(beanName);
		if (TransactionFeignErrorDecoder.class.isInstance(beanInst)) {
			continue;
		} else if (errorDecoder != null) {
			throw new RuntimeException("There are more than one feign.codec.ErrorDecoder exists!");
		} else {
			errorDecoder = (feign.codec.ErrorDecoder) beanInst;
		}
	}

	if (errorDecoder == null) {
		errorDecoder = new ErrorDecoder.Default();
	} // end-if (errorDecoder == null)

	this.delegate = errorDecoder;
}
 
Example 3
Source File: FeignErrorDecoderFactoryTests.java    From spring-cloud-openfeign with Apache License 2.0 4 votes vote down vote up
@Bean
public ErrorDecoder errorDecoder() {
	return new ErrorDecoder.Default();
}
 
Example 4
Source File: FeignClientErrorDecoderTests.java    From spring-cloud-openfeign with Apache License 2.0 4 votes vote down vote up
@Bean
ErrorDecoder feignErrorDecoder() {
	return new ErrorDecoder.Default();
}
 
Example 5
Source File: FeignClientOverrideDefaultsTests.java    From spring-cloud-openfeign with Apache License 2.0 4 votes vote down vote up
@Bean
ErrorDecoder feignErrorDecoder() {
	return new ErrorDecoder.Default();
}
 
Example 6
Source File: SpringCloudConfiguration.java    From ByteJTA with GNU Lesser General Public License v3.0 4 votes vote down vote up
@org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean(feign.codec.ErrorDecoder.class)
@org.springframework.context.annotation.Bean
public feign.codec.ErrorDecoder errorDecoder() {
	return new ErrorDecoder.Default();
}
 
Example 7
Source File: ClientConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
public ErrorDecoder errorDecoder() {
    return new ErrorDecoder.Default();
}