Skip to content

Commit c1b7603

Browse files
committed
Added exception handling for stream not found
1 parent 84b1875 commit c1b7603

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

generator/cybersource-javascript-template/ApiClient.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@
393393

394394
try {
395395
// 404 is caused by missing resource / resource not found
396-
tester.response.text = JSON.stringify(error.response.data);
396+
if (error.response.config.responseType != 'stream'){
397+
tester.response.text = JSON.stringify(error.response.data);
398+
} else { throw "Exception during streaming"; }
397399
} catch(err) {
398400
// 404 is caused by unexpected end of stream or stream not found
399401
tester.response.text = error.message;

0 commit comments

Comments
 (0)