Standardize exceptions for the ruby implementation