当不支持的参数类型被设置为作业参数时引发。我们目前支持 String
、Integer
、Float
、NilClass
、TrueClass
、FalseClass
、BigDecimal
、Symbol
、Date
、Time
、DateTime
、ActiveSupport::TimeWithZone
、ActiveSupport::Duration
、Hash
、ActiveSupport::HashWithIndifferentAccess
、Array
、Range
或 GlobalID::Identification 实例,尽管可以通过添加自定义序列化程序来扩展此功能。如果您将 Hash
的键设置为字符串或符号以外的内容,则会引发异常。在尝试序列化无法使用 GlobalID 识别的对象(例如未持久化的 Active Record 模型)时也会引发异常。