Skip to main content

AppLockError

Thrown when the app lock is refused: another run holds it (held), the lock to resume is not the one held (not-held), the state moved since it was last refreshed (state-moved), or the state holds journal files of a run that was never archived (unfinished), named in stateFileNames.

@group

Errors/Transaction

@throws

When another run holds the lock, or the lock given is not the one held.

@throws

When a command that needs the app locked runs while the app is not locked.

@throws

When state moved since it was last read, or holds a run that was never archived.

Hierarchy

Index

Constructors

constructor

  • AppLockError(message: string, details: { holder?: { commitId?: string; context?: string; lockId: string; takenAt?: number }; newestCommitId?: string; reason: held | not-held | state-moved | unfinished; refreshedCommitId?: string; stateFileNames?: string[] }): AppLockError
  • Parameters

    • message: string

      The error message.

    • details: { holder?: { commitId?: string; context?: string; lockId: string; takenAt?: number }; newestCommitId?: string; reason: held | not-held | state-moved | unfinished; refreshedCommitId?: string; stateFileNames?: string[] }

      Why the lock was refused, and what the state provider knows about it.

      • optionalholder: { commitId?: string; context?: string; lockId: string; takenAt?: number }
      • optionalnewestCommitId: string
      • reason: held | not-held | state-moved | unfinished
      • optionalrefreshedCommitId: string
      • optionalstateFileNames: string[]

    Returns AppLockError

Properties

optionalreadonlyholder

holder?: { commitId?: string; context?: string; lockId: string; takenAt?: number }

The lock held now, when one is: its id, the commit it was taken on, who took it and when (epoch milliseconds).


Type declaration

  • optionalcommitId?: string
  • optionalcontext?: string
  • lockId: string
  • optionaltakenAt?: number

optionalreadonlynewestCommitId

newestCommitId?: string

For state-moved, the newest commit in state, which the run never read.

readonlyreason

reason: held | not-held | state-moved | unfinished

Why the lock was refused.

optionalreadonlyrefreshedCommitId

refreshedCommitId?: string

For state-moved, the commit the run last read.

optionalreadonlystateFileNames

stateFileNames?: string[]

For unfinished, the journal files of the run that was never archived.