Replace usage of StandardError with Exception

StandardError is no longer supported as of 3.3, so we should just use
Exception. Clearer semantically anyway.