24 lines
		
	
	
		
			339 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			339 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| require_relative "devops_error"
 | |
| class InvalidRecord < ::Devops::Exception::DevopsError
 | |
| 
 | |
|   def initialize msg
 | |
|     if msg.is_a?(String)
 | |
|       super(msg)
 | |
|     else
 | |
|       @object = msg
 | |
|     end
 | |
|   end
 | |
| 
 | |
|   def http_status
 | |
|     400
 | |
|   end
 | |
| 
 | |
|   def http_body
 | |
|     if @object.nil?
 | |
|       super
 | |
|     else
 | |
|       JSON.pretty_generate(@object)
 | |
|     end
 | |
|   end
 | |
| end
 | 
