Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #375 from ScorexFoundation/perf-optimizatons
Browse files Browse the repository at this point in the history
Performance optimizations
  • Loading branch information
aslesarenko committed Oct 22, 2020
2 parents 1086cef + 03fbc66 commit ab86f9c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/scala/scorex/core/validation/ModifierError.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package scorex.core.validation

import scala.util.control.NoStackTrace

/** Base trait for errors that were occurred during NodeView Modifier validation
*/
trait ModifierError {
Expand All @@ -22,11 +24,12 @@ class MalformedModifierError(val message: String, cause: Option[Throwable] = Non
def toThrowable: Throwable = this
}

/** Temporary modifier error that may be recovered in future after some history updates
/** Temporary modifier error that may be recovered in future after some history updates.
* When an instance is created, the stack trace is not collected which makes this exception lightweight.
*/
@SuppressWarnings(Array("org.wartremover.warts.Null"))
class RecoverableModifierError(val message: String, cause: Option[Throwable] = None)
extends Exception(message, cause.orNull) with ModifierError {
extends Exception(message, cause.orNull) with ModifierError with NoStackTrace {
def isFatal: Boolean = false
def toThrowable: Throwable = this
}
Expand Down

0 comments on commit ab86f9c

Please sign in to comment.