We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa07285 commit f9c3667Copy full SHA for f9c3667
2 files changed
bin/cli.js
@@ -43,6 +43,7 @@ const timeStart = process.hrtime();
43
spec = await loadSpec(pathToSpec);
44
} catch (e) {
45
console.error(chalk.red(`❌ "${e}"`));
46
+ return;
47
}
48
49
const result = swaggerToTS(spec, {
bin/loaders/index.js
@@ -26,10 +26,14 @@ module.exports.loadSpec = async (pathToSpec) => {
26
if (isYamlSpec(rawSpec, pathToSpec)) {
27
return yaml.safeLoad(rawSpec);
28
29
- } catch {
30
- throw new Error(
31
- `The spec under ${pathToSpec} seems to be YAML, but it couldn’t be parsed.`
32
- );
+ } catch (err) {
+ let message = `The spec under ${pathToSpec} seems to be YAML, but it couldn’t be parsed.`;
+
+ if (err.message) {
33
+ message += `\n${err.message}`;
34
+ }
35
36
+ throw new Error(message);
37
38
39
try {
0 commit comments