You’re not throwing an exception, but the class of an exception (just read the compiler error message…). You have to throw an exception instance.
case x:Exception => throw new CustomException("whatever")
You’re not throwing an exception, but the class of an exception (just read the compiler error message…). You have to throw an exception instance.
case x:Exception => throw new CustomException("whatever")