From 2d3a28b949f2e8a0b755afdb52cbcd55e5ac0d98 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Fri, 10 Aug 2018 18:37:46 -0400 Subject: Document all Active Storage error classes [ci skip] --- activestorage/lib/active_storage/errors.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activestorage/lib/active_storage') diff --git a/activestorage/lib/active_storage/errors.rb b/activestorage/lib/active_storage/errors.rb index 0547b8e705..f4bf66a615 100644 --- a/activestorage/lib/active_storage/errors.rb +++ b/activestorage/lib/active_storage/errors.rb @@ -4,8 +4,16 @@ module ActiveStorage # Generic base class for all Active Storage exceptions. class Error < StandardError; end + # Raised when ActiveStorage::Blob#variant is called on a blob that isn't variable. + # Use ActiveStorage::Blob#variable? to determine whether a blob is variable. class InvariableError < Error; end + + # Raised when ActiveStorage::Blob#preview is called on a blob that isn't previewable. + # Use ActiveStorage::Blob#previewable? to determine whether a blob is previewable. class UnpreviewableError < Error; end + + # Raised when ActiveStorage::Blob#representation is called on a blob that isn't representable. + # Use ActiveStorage::Blob#representable? to determine whether a blob is representable. class UnrepresentableError < Error; end # Raised when uploaded or downloaded data does not match a precomputed checksum. -- cgit v1.2.3