get-connpass-items
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -11,8 +11,7 @@ 'use strict'; | ||
var Spinner = require('cli-spinner').Spinner; | ||
var spinner = new Spinner('proccessing... %s'); | ||
var spinner = new Spinner('Proccessing... %s'); | ||
spinner.setSpinnerString(18); | ||
var instance = axios.create({ | ||
baseURL: 'https://connpass.com/api/v1/', | ||
timeout: 10000 | ||
baseURL: 'https://connpass.com/api/v1/' | ||
}); | ||
@@ -42,10 +41,15 @@ | ||
}).catch(function (err) { | ||
if (err.config.timeout === 10000) { | ||
console.log('\n'); | ||
console.log(boxen(' Request timeout ;( \n Please try again.', { borderColor: 'red' })); | ||
} else { | ||
console.error(err.config); | ||
spinner.stop(); | ||
console.log('\n'); | ||
switch (err.response.status) { | ||
case 502: | ||
console.log(boxen(' Now on maintenance ', { borderColor: 'red' })); | ||
break; | ||
case 504: | ||
default: | ||
console.log(boxen(' Internal Server Error ', { borderColor: 'red' })); | ||
break; | ||
} | ||
spinner.stop(); | ||
}); | ||
}; |
{ | ||
"name": "get-connpass-items", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "get-connpass-items(csm) is a CLI application.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -9,8 +9,7 @@ const yargs = require('yargs') | ||
const Spinner = require('cli-spinner').Spinner | ||
const spinner = new Spinner('proccessing... %s') | ||
const spinner = new Spinner('Proccessing... %s') | ||
spinner.setSpinnerString(18) | ||
const instance = axios.create({ | ||
baseURL: 'https://connpass.com/api/v1/', | ||
timeout: 10000 | ||
baseURL: 'https://connpass.com/api/v1/' | ||
}) | ||
@@ -49,12 +48,15 @@ | ||
.catch((err) => { | ||
if (err.config.timeout === 10000) { | ||
console.log('\n') | ||
console.log(boxen(' Request timeout ;( \n Please try again.', { borderColor: 'red' } | ||
)) | ||
spinner.stop() | ||
console.log('\n') | ||
switch (err.response.status) { | ||
case 502: | ||
console.log(boxen(' Now on maintenance ', { borderColor: 'red' })) | ||
break | ||
case 504: | ||
default: | ||
console.log(boxen(' Internal Server Error ', { borderColor: 'red' })) | ||
break | ||
} | ||
else { | ||
console.error(err.config) | ||
} | ||
spinner.stop() | ||
}) | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11667
219