@@ -198,15 +198,15 @@ export default class ScribePartitionConnection extends PartitionConnection {
198198 // currently in the truth log write queue have been written, or
199199 // undefined if there are no pending truth writes.
200200 _triggerTruthLogWrites ( lastTruthCommandId ? : any ) {
201- this . _clampCommandQueueByTruthEvendIdEnd ( lastTruthCommandId ) ;
201+ this . _clampCommandQueueByTruthEventIdEnd ( lastTruthCommandId ) ;
202202 if ( ! this . _truthLogInfo . writeQueue . length ) return undefined ;
203203 if ( this . _truthLogInfo . writeProcess ) {
204204 return this . _truthLogInfo . writeProcess . then ( ( ) => this . _truthLogInfo . writeProcess ) ;
205205 }
206206 return _triggerEventQueueWrites ( this , this . _truthLogInfo , this . _writeTruths . bind ( this ) ) ;
207207 }
208208
209- _clampCommandQueueByTruthEvendIdEnd ( lastTruthCommandId ? : any ) {
209+ _clampCommandQueueByTruthEventIdEnd ( lastTruthCommandId ? : any ) {
210210 const deleteBegin = this . _commandQueueInfo . eventIdBegin ;
211211 if ( ! ( deleteBegin < this . _truthLogInfo . eventIdEnd ) ) return undefined ;
212212 const commandIds = this . _commandQueueInfo . commandIds ;
@@ -223,12 +223,18 @@ export default class ScribePartitionConnection extends PartitionConnection {
223223 this . _commandQueueInfo . eventIdBegin = this . _commandQueueInfo . eventIdEnd =
224224 this . _truthLogInfo . eventIdEnd ;
225225 }
226+ const wrap = new Error ( `_clampCommandQueueByTruthEventIdEnd(${ lastTruthCommandId } )` ) ;
226227 return ! deletedIds . length ? undefined : thenChainEagerly (
227228 _deleteCommands ( this , deleteBegin , deleteBegin + deletedIds . length , deletedIds ) ,
228229 commands => commands ,
229230 error => {
230- if ( typeof error . conflictingCommandEventId !== "number" ) throw error ;
231- this . _reloadCommandQueue ( error . conflictingCommandEventId ) ;
231+ if ( typeof error . conflictingCommandEventId === "number" ) {
232+ return this . _reloadCommandQueue ( error . conflictingCommandEventId ) ;
233+ }
234+ throw this . wrapErrorEvent ( error , wrap ,
235+ "\n\tdeleteBegin:" , deleteBegin ,
236+ "\n\tdeleteBegin + len:" , deleteBegin + deletedIds . length ,
237+ "\n\tdeletedIds:" , deletedIds ) ;
232238 } ) ;
233239 }
234240
0 commit comments