Index: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
index 0adcb7c08c18fef7a5854aad5bb668a64e8c21d6..fe84aca14add17eb173ed63ab0653d55be4b7ac0 100644 |
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
@@ -125,6 +125,11 @@ struct TypeConverter<PaymentDetailsPtr, blink::PaymentDetails> { |
else |
output->modifiers = mojo::WTFArray<PaymentDetailsModifierPtr>::New(0); |
+ if (input.hasError()) |
+ output->error = input.error(); |
+ else |
+ output->error = WTF::emptyString(); |
+ |
return output; |
} |
}; |
@@ -519,6 +524,11 @@ PaymentRequest::PaymentRequest(ScriptState* scriptState, const HeapVector<Paymen |
if (exceptionState.hadException()) |
return; |
+ if (details.hasError() && !details.error().isEmpty()) { |
+ exceptionState.throwTypeError("Error value should be empty"); |
+ return; |
+ } |
+ |
if (m_options.requestShipping()) |
m_shippingOption = getSelectedShippingOption(details); |