private BaseException createException ( int httpStatusCode , JsonContent jsonContent ) { return unmarshallers . stream ( ) . filter ( u -> u . matches ( httpStatusCode ) ) . findFirst ( ) . map ( u -> safeUnmarshall ( jsonContent , u ) ) . orElseThrow ( this :: createUnknownException ) ; }
Create an AmazonServiceException using the chain of unmarshallers . This method will never return null it will always return a valid exception .