Commit beaeaeda authored by Thomas Van Lenten's avatar Thomas Van Lenten

Use runtime_error vs just exiting for some issues.

release notes: no
parent 37297b25
...@@ -68,7 +68,8 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) { ...@@ -68,7 +68,8 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
switch (request.payloadOneOfCase) { switch (request.payloadOneOfCase) {
case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase: case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase:
Die(@"Request didn't have a payload: %@", request); response.runtimeError =
[NSString stringWithFormat:@"Request didn't have a payload: %@", request];
break; break;
case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: { case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: {
...@@ -78,7 +79,10 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) { ...@@ -78,7 +79,10 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
} else if ([request.messageType isEqual:@"protobuf_test_messages.proto2.TestAllTypesProto2"]) { } else if ([request.messageType isEqual:@"protobuf_test_messages.proto2.TestAllTypesProto2"]) {
msgClass = [TestAllTypesProto2 class]; msgClass = [TestAllTypesProto2 class];
} else { } else {
Die(@"Protobuf request had an unknown message_type: %@", request.messageType); response.runtimeError =
[NSString stringWithFormat:
@"Protobuf request had an unknown message_type: %@", request.messageType];
break;
} }
NSError *error = nil; NSError *error = nil;
testMessage = [msgClass parseFromData:request.protobufPayload error:&error]; testMessage = [msgClass parseFromData:request.protobufPayload error:&error];
...@@ -108,7 +112,8 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) { ...@@ -108,7 +112,8 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
switch (request.requestedOutputFormat) { switch (request.requestedOutputFormat) {
case WireFormat_GPBUnrecognizedEnumeratorValue: case WireFormat_GPBUnrecognizedEnumeratorValue:
case WireFormat_Unspecified: case WireFormat_Unspecified:
Die(@"Unrecognized/unspecified output format: %@", request); response.runtimeError =
[NSString stringWithFormat:@"Unrecognized/unspecified output format: %@", request];
break; break;
case WireFormat_Protobuf: case WireFormat_Protobuf:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment