change error handling

This commit is contained in:
Bassel 2023-03-23 11:54:58 +02:00
parent a201021ca5
commit 28a4704210

View File

@ -183,18 +183,8 @@ class RemoteStrapiDestinationProvider implements IDestinationProvider {
});
server.once('error', (err) => {
if (err.message === 'Unexpected server response: 401') {
reject(
new ProviderValidationError('Invalid Transfer Token', {
check: 'auth.token',
details: {
error: err.message,
},
})
);
}
reject(
new ProviderTransferError('Error connecting to server', {
new ProviderTransferError(err.message, {
details: {
error: err.message,
},