diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-12-01 11:33:02 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-12-19 15:45:08 -0600 |
commit | 8d0ad36bcfc0ef95ee9a116604ba1516367dbb27 (patch) | |
tree | 4ad2281ad83ead5df3ff1e3e6aaf7bdd25a67602 /app/models/concerns | |
parent | 2f92238a6ea5550f94a4ece8453cbf6bdee1f77d (diff) | |
download | gitlab-ce-8d0ad36bcfc0ef95ee9a116604ba1516367dbb27.tar.gz |
Add a JsonSerializationError class instead of raising SecurityError
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/blocks_json_serialization.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/concerns/blocks_json_serialization.rb b/app/models/concerns/blocks_json_serialization.rb index 75c6742260e..8019e6adc1c 100644 --- a/app/models/concerns/blocks_json_serialization.rb +++ b/app/models/concerns/blocks_json_serialization.rb @@ -5,8 +5,10 @@ module BlocksJsonSerialization extend ActiveSupport::Concern - def to_json(*args) - raise SecurityError, + JsonSerializationError = Class.new(StandardError) + + def to_json(*) + raise JsonSerializationError, "JSON serialization has been disabled on #{self.class.name}" end |