Code Duplication    Length = 4-4 lines in 2 locations

includes/class-wc-stripe-api.php 2 locations

@@ 120-123 (lines=4) @@
117
			)
118
		);
119
120
		if ( is_wp_error( $response ) || empty( $response['body'] ) ) {
121
			WC_Stripe_Logger::log( 'Error Response: ' . print_r( $response, true ) );
122
			throw new Exception( __( 'There was a problem connecting to the Stripe API endpoint.', 'woocommerce-gateway-stripe' ) );
123
		}
124
125
		return json_decode( $response['body'] );
126
	}
@@ 149-152 (lines=4) @@
146
			)
147
		);
148
149
		if ( is_wp_error( $response ) || empty( $response['body'] ) ) {
150
			WC_Stripe_Logger::log( 'Error Response: ' . print_r( $response, true ) );
151
			return new WP_Error( 'stripe_error', __( 'There was a problem connecting to the Stripe API endpoint.', 'woocommerce-gateway-stripe' ) );
152
		}
153
154
		return json_decode( $response['body'] );
155
	}