File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ const timeStart = process.hrtime();
4343 spec = await loadSpec ( pathToSpec ) ;
4444 } catch ( e ) {
4545 console . error ( chalk . red ( `❌ "${ e } "` ) ) ;
46+ return ;
4647 }
4748
4849 const result = swaggerToTS ( spec , {
Original file line number Diff line number Diff line change @@ -26,10 +26,14 @@ module.exports.loadSpec = async (pathToSpec) => {
2626 if ( isYamlSpec ( rawSpec , pathToSpec ) ) {
2727 return yaml . safeLoad ( rawSpec ) ;
2828 }
29- } catch {
30- throw new Error (
31- `The spec under ${ pathToSpec } seems to be YAML, but it couldn’t be parsed.`
32- ) ;
29+ } catch ( err ) {
30+ let message = `The spec under ${ pathToSpec } seems to be YAML, but it couldn’t be parsed.` ;
31+
32+ if ( err . message ) {
33+ message += `\n${ err . message } ` ;
34+ }
35+
36+ throw new Error ( message ) ;
3337 }
3438
3539 try {
You can’t perform that action at this time.
0 commit comments