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();
43
43
spec = await loadSpec ( pathToSpec ) ;
44
44
} catch ( e ) {
45
45
console . error ( chalk . red ( `❌ "${ e } "` ) ) ;
46
+ return ;
46
47
}
47
48
48
49
const result = swaggerToTS ( spec , {
Original file line number Diff line number Diff line change @@ -26,10 +26,14 @@ module.exports.loadSpec = async (pathToSpec) => {
26
26
if ( isYamlSpec ( rawSpec , pathToSpec ) ) {
27
27
return yaml . safeLoad ( rawSpec ) ;
28
28
}
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 ) ;
33
37
}
34
38
35
39
try {
You can’t perform that action at this time.
0 commit comments