Sha256: cbeb96ba240117553bd9b5448edd707b47a8b5a196fe8f08faac77f341754713
Contents?: true
Size: 1.15 KB
Versions: 2
Compression:
Stored size: 1.15 KB
Contents
module JsonapiCompliable module Errors class BadFilter < StandardError; end class ValidationError < StandardError; end class UnsupportedPageSize < StandardError def initialize(size, max) @size, @max = size, max end def message "Requested page size #{@size} is greater than max supported size #{@max}" end end class InvalidInclude < StandardError def initialize(relationship, parent_resource) @relationship = relationship @parent_resource = parent_resource end def message "The requested included relationship \"#{@relationship}\" is not supported on resource \"#{@parent_resource}\"" end end class StatNotFound < StandardError def initialize(attribute, calculation) @attribute = attribute @calculation = calculation end def message "No stat configured for calculation #{pretty(@calculation)} on attribute #{pretty(@attribute)}" end private def pretty(input) if input.is_a?(Symbol) ":#{input}" else "'#{input}'" end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jsonapi_compliable-0.11.0 | lib/jsonapi_compliable/errors.rb |
jsonapi_compliable-0.10.9 | lib/jsonapi_compliable/errors.rb |