Clearer error message

@gaurave

Small step towards improving the user experience from #2593.
Do you intend to `return new Future.error(new SparkException(msg, errorCode: errorCode)` here  instead of `throw`?