Throw exceptions for bad contexts.