class ExtendableError extends Error {
  constructor (message) {
    super(message)
    this.name = this.constructor.name
    if (typeof Error.captureStackTrace === 'function') {
      Error.captureStackTrace(this, this.constructor)
    } else {
      this.stack = (new Error(message)).stack
    }
  }
}

class NotImplementedException extends ExtendableError {
  constructor () {
    super('Required method is not implmented.')
  }
}

class UnauthorizedQueryException extends ExtendableError {
  constructor () {
    super('Query not authorized.')
  }
}

class UserReachedMaxLevelException extends ExtendableError {
  constructor () {
    super('There are no more levels user at max level.')
  }
}

class MockDatabaseException extends ExtendableError {

}

class EmptyOperationStackException extends MockDatabaseException {
  constructor () {
    super('Operation stack is empty. Check if you set your expected data in the test.')
  }
}

class OperationMissmatchException extends MockDatabaseException {
  constructor (expectedOperation, receivedOperation) {
    const message = `Expected <${expectedOperation}> operation but 
              received <${receivedOperation}> operation instead.`

    super(message)
  }
}

export {
  NotImplementedException,
  UnauthorizedQueryException,
  UserReachedMaxLevelException,
  EmptyOperationStackException,
  OperationMissmatchException
}

@@ -410,16 +410,17 @@
 not impl
+e
 mented.'
@@ -417,24 +417,24 @@
 lemented.')%0A
-
   %7D%0A%7D%0A%0Aclass
@@ -667,16 +667,28 @@
 vels
+. The
  user 
-at
+is at the
  max
@@ -947,288 +947,10 @@
 %0A%7D%0A%0A
-class OperationMissmatchException extends MockDatabaseException %7B%0A  constructor (expectedOperation, receivedOperation) %7B%0A    const message = %60Expected %3C$%7BexpectedOperation%7D%3E operation but %0A              received %3C$%7BreceivedOperation%7D%3E operation instead.%60%0A%0A    super(message)%0A  %7D%0A%7D
+//
 %0A%0Aex
@@ -1045,16 +1045,16 @@
 eption,%0A
+
   EmptyO
@@ -1079,38 +1079,7 @@
 tion
-,%0A  OperationMissmatchException
 %0A%7D%0A

Clean up custom errors