mirror of
https://github.com/amark/gun.git
synced 2025-06-14 01:56:45 +00:00
19 lines
515 B
JavaScript
19 lines
515 B
JavaScript
var AWS = require('../core');
|
|
|
|
AWS.util.update(AWS.ElasticTranscoder.prototype, {
|
|
setupRequestListeners: function setupRequestListeners(request) {
|
|
request.addListener('extractError', this.extractErrorCode);
|
|
},
|
|
|
|
/**
|
|
* @api private
|
|
*/
|
|
extractErrorCode: function extractErrorCode(resp) {
|
|
// ETS stores error type in the header
|
|
var errorType = resp.httpResponse.headers['x-amzn-errortype'];
|
|
if (errorType) {
|
|
resp.error.name = resp.error.code = errorType.split(':')[0];
|
|
}
|
|
}
|
|
});
|