diff --git a/lib/flight_asset/credentials_config.rb b/lib/flight_asset/credentials_config.rb index 6ed68be..1ec4fcc 100644 --- a/lib/flight_asset/credentials_config.rb +++ b/lib/flight_asset/credentials_config.rb @@ -78,6 +78,12 @@ def raise_if_known_422 #{Paint["#{Config::CACHE.app_name} show-container PARENT_CONTAINER", :yellow]} ERROR end + + if xy_end_position + raise ClientError, <<~ERROR.chomp + The #{xy_end_position} end position must be greater than the #{xy_end_position} start position + ERROR + end end ## @@ -96,6 +102,20 @@ def xy_capacity end end + ## + # @returns [String] if the error was due to the xEndPosition or yEndPosition + # @returns [Nil] if the error was not due to the xEndPosition or yEndPosition + def xy_end_position + case pointer + when "/data/relationships/xEndPosition/data" + 'x' + when "/data/relationships/yEndPosition/data" + 'y' + else + nil + end + end + ## # Returns true if the error was due to the parent container def parent_container?