File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ export default class LineBot extends EventEmitter {
2424
2525 constructor ( { secret, token, options = { } } ) {
2626 super ( )
27+ if ( ! secret ) throw new Error ( 'Please supply a LINE Secret.' )
28+ if ( ! token ) throw new Error ( 'Please supply a LINE Token.' )
2729 this . secret = secret
2830 this . token = token
2931 this . options = options
@@ -59,7 +61,7 @@ export default class LineBot extends EventEmitter {
5961 data : payload || { }
6062 }
6163 if ( type === 'content' ) opts . responseType = 'arraybuffer'
62- return axios ( opts ) . catch ( err => err . response )
64+ return axios ( opts ) . catch ( err => Promise . reject ( err . response ) )
6365 }
6466
6567 processEvents ( events , req ) {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class Webhook {
1818
1919 this . _parseBody = this . _parseBody . bind ( this )
2020 this . _getSignature = this . _getSignature . bind ( this )
21+ this . _verifyRequest = this . _verifyRequest . bind ( this )
2122 this . _createTunnel = this . _createTunnel . bind ( this )
2223
2324 const app = express ( )
You can’t perform that action at this time.
0 commit comments