@@ -60,16 +60,12 @@ YargsParser.command(
60
60
return yargs ;
61
61
} ,
62
62
async argv => {
63
- try {
64
- await serve ( argv . port , argv . spec , {
65
- ssr : argv . ssr ,
66
- watch : argv . watch ,
67
- templateFileName : argv . template ,
68
- redocOptions : argv . options || { } ,
69
- } ) ;
70
- } catch ( e ) {
71
- console . log ( e . stack ) ;
72
- }
63
+ await serve ( argv . port , argv . spec , {
64
+ ssr : argv . ssr ,
65
+ watch : argv . watch ,
66
+ templateFileName : argv . template ,
67
+ redocOptions : argv . options || { } ,
68
+ } ) ;
73
69
} ,
74
70
)
75
71
. command (
@@ -103,18 +99,14 @@ YargsParser.command(
103
99
return yargs ;
104
100
} ,
105
101
async argv => {
106
- try {
107
- await bundle ( argv . spec , {
108
- ssr : true ,
109
- output : argv . o ,
110
- cdn : argv . cdn ,
111
- title : argv . title ,
112
- templateFileName : argv . template ,
113
- redocOptions : argv . options || { } ,
114
- } ) ;
115
- } catch ( e ) {
116
- console . log ( e . message ) ;
117
- }
102
+ await bundle ( argv . spec , {
103
+ ssr : true ,
104
+ output : argv . o ,
105
+ cdn : argv . cdn ,
106
+ title : argv . title ,
107
+ templateFileName : argv . template ,
108
+ redocOptions : argv . options || { } ,
109
+ } ) ;
118
110
} ,
119
111
)
120
112
. demandCommand ( )
@@ -125,6 +117,10 @@ YargsParser.command(
125
117
} )
126
118
. options ( 'options' , {
127
119
describe : 'ReDoc options, use dot notation, e.g. options.nativeScrollbars' ,
120
+ } )
121
+ . fail ( ( message , error ) => {
122
+ console . log ( error . stack ) ;
123
+ process . exit ( 1 ) ;
128
124
} ) . argv ;
129
125
130
126
async function serve ( port : number , pathToSpec : string , options : Options = { } ) {
0 commit comments