Exception: FlexColumns::Errors::JsonTooLongError
Overview
Raised when you try to store enough data in a flex column that the generated JSON is too long to fit into the column.
Instance Attribute Summary collapse
-
#data_source ⇒ Object
readonly
Returns the value of attribute data_source.
-
#json_string ⇒ Object
readonly
Returns the value of attribute json_string.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
Instance Method Summary collapse
-
#initialize(data_source, limit, json_string) ⇒ JsonTooLongError
constructor
A new instance of JsonTooLongError.
Constructor Details
#initialize(data_source, limit, json_string) ⇒ JsonTooLongError
Returns a new instance of JsonTooLongError.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/flex_columns/errors.rb', line 75 def initialize(data_source, limit, json_string) @data_source = data_source @limit = limit @json_string = json_string super(%{When trying to serialize JSON for #{data_source.describe_flex_column_data_source}, the JSON produced was too long to fit in the database. We produced #{json_string.length} characters of JSON, but the database's limit for that column is #{limit} characters. The JSON we produced was: #{FlexColumns::Util::StringUtils.abbreviated_string(json_string)}}) end |
Instance Attribute Details
#data_source ⇒ Object (readonly)
Returns the value of attribute data_source.
73 74 75 |
# File 'lib/flex_columns/errors.rb', line 73 def data_source @data_source end |
#json_string ⇒ Object (readonly)
Returns the value of attribute json_string.
73 74 75 |
# File 'lib/flex_columns/errors.rb', line 73 def json_string @json_string end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
73 74 75 |
# File 'lib/flex_columns/errors.rb', line 73 def limit @limit end |