the-algorithm/unified_user_actions/enricher/src/main/scala/com/twitter/unified_user_actions/enricher/Exceptions.scala
twitter-team 617c8c787d Open-sourcing Unified User Actions
Unified User Action (UUA) is a centralized, real-time stream of user actions on Twitter, consumed by various product, ML, and marketing teams. UUA makes sure all internal teams consume the uniformed user actions data in an accurate and fast way.
2023-04-14 16:45:37 -05:00

17 lines
543 B
Scala

package com.twitter.unified_user_actions.enricher
/**
* When this exception is thrown, it means that an assumption in the enricher services
* was violated and it needs to be fixed before a production deployment.
*/
abstract class FatalException(msg: String) extends Exception(msg)
class ImplementationException(msg: String) extends FatalException(msg)
object Exceptions {
def require(requirement: Boolean, message: String): Unit = {
if (!requirement)
throw new ImplementationException("requirement failed: " + message)
}
}