Skip to content

Commit 6296c7c

Browse files
committed
restore try/catch block
1 parent 10a3075 commit 6296c7c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

models/OpenAPI/Parser.cfc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ component name="OpenAPIParser" accessors="true" {
296296

297297
var ReferenceDocument = {};
298298

299-
// try{
299+
try{
300300

301301
//Files receive a parser reference
302302
if( left( FilePath, 4 ) == 'http' ){
@@ -325,19 +325,19 @@ component name="OpenAPIParser" accessors="true" {
325325

326326
}
327327

328-
// } catch( any e ){
328+
} catch( any e ){
329329

330-
// // if this is a known exception or occured via recursion, rethrow the exception so the user knows which JSON file triggered it
331-
// if ( listFindNoCase( "SwaggerSDK.ParserException,CBSwagger.InvalidReferenceDocumentException", e.type ) ) {
332-
// rethrow;
333-
// }
330+
// if this is a known exception or occured via recursion, rethrow the exception so the user knows which JSON file triggered it
331+
if ( listFindNoCase( "SwaggerSDK.ParserException,CBSwagger.InvalidReferenceDocumentException", e.type ) ) {
332+
rethrow;
333+
}
334334

335-
// throw(
336-
// type="CBSwagger.InvalidReferenceDocumentException",
337-
// message="The $ref file pointer of #$ref# could not be loaded and parsed as a valid object. If your $ref file content is an array, please nest the array within an object as a named key."
338-
// );
335+
throw(
336+
type="CBSwagger.InvalidReferenceDocumentException",
337+
message="The $ref file pointer of #$ref# could not be loaded and parsed as a valid object. If your $ref file content is an array, please nest the array within an object as a named key. The message received was: #e.message# #e.detail#"
338+
);
339339

340-
// }
340+
}
341341

342342
return ReferenceDocument;
343343
}

0 commit comments

Comments
 (0)