1
0
Fork 0

DeltaPublisher#_sendMessage: Promise.reject=>throw

Purely stylistic.
master
Mike Gerwitz 2019-12-09 15:06:43 -05:00 committed by Austin Schaffer
parent fb80d2a8b4
commit 8e0c0e22a8
1 changed files with 4 additions and 6 deletions

View File

@ -121,14 +121,14 @@ export class DeltaPublisher implements AmqpPublisher
if ( !channel )
{
return Promise.reject( context (
throw context(
new AmqpError( 'Error sending message: No channel' ),
{
doc_id: doc_id,
delta_type: delta.type,
delta_ts: delta.timestamp,
},
) );
);
}
// we don't use a routing key; fanout exchange
@ -141,17 +141,15 @@ export class DeltaPublisher implements AmqpPublisher
if ( !published_successfully )
{
return Promise.reject( context(
throw context(
new Error ( 'Delta publish failed' ),
{
doc_id: doc_id,
delta_type: delta.type,
delta_ts: delta.timestamp,
}
) );
);
}
return Promise.resolve();
} );
}