@@ -120,33 +120,37 @@ async function doPublish() {
120
120
function errorHandler ( error ) {
121
121
spinner . stop ( ) ;
122
122
123
+ console . log ( error ?. response ?. body ?? error ) ;
124
+ process . exitCode = 1 ;
125
+
123
126
if ( error ?. name === 'HTTPError' ) {
124
127
const response = JSON . parse ( error ?. response ?. body ?? '{}' ) ;
125
128
const { clientId, refreshToken } = apiConfig ;
126
129
if ( response . error_description === 'The OAuth client was not found.' ) {
127
- console . error ( 'Error: `The OAuth client was not found`' ) ;
128
130
console . error (
129
131
'Probably the provided client ID is not valid. Try following the guide again' ,
130
132
) ;
131
133
console . error (
132
134
'https://github.com/fregante/chrome-webstore-upload/blob/main/How%20to%20generate%20Google%20API%20keys.md' ,
133
135
) ;
134
136
console . error ( { clientId } ) ;
135
- process . exitCode = 1 ;
136
137
return ;
137
138
}
138
139
139
140
if ( response . error_description === 'Bad Request' ) {
140
141
const { clientId } = apiConfig ;
141
- console . error ( 'Error: `invalid_grant`' ) ;
142
142
console . error (
143
143
'Probably the provided refresh token is not valid. Try following the guide again' ,
144
144
) ;
145
145
console . error (
146
146
'https://github.com/fregante/chrome-webstore-upload/blob/main/How%20to%20generate%20Google%20API%20keys.md' ,
147
147
) ;
148
148
console . error ( { clientId, refreshToken } ) ;
149
- process . exitCode = 1 ;
149
+ return ;
150
+ }
151
+
152
+ if ( error ?. message === 'Response code 400 (Bad Request)' ) {
153
+ // Nothing else to add
150
154
return ;
151
155
}
152
156
}
@@ -156,14 +160,7 @@ function errorHandler(error) {
156
160
console . error ( 'Error: ' + itemError . error_code ) ;
157
161
console . error ( itemError . error_detail ) ;
158
162
}
159
-
160
- process . exitCode = 1 ;
161
- return ;
162
163
}
163
-
164
- console . error ( 'Error' ) ;
165
- console . error ( error ) ;
166
- process . exitCode = 1 ;
167
164
}
168
165
169
166
async function init ( ) {
0 commit comments