/usr/lib/ruby/vendor_ruby/ms_rest/deserialization_error.rb is in ruby-ms-rest 0.6.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'json'
module MsRest
#
# Class which represents an error happening during deserialization of server response.
#
class DeserializationError < RestError
# @return [String] the inner exception message.
attr_accessor :exception_message
# @return [String] the inner exception stacktrace.
attr_accessor :exception_stacktrace
# @return [MsRest::HttpOperationResponse] server response which client was unable to parse.
attr_accessor :result
#
# Creates and initialize new instance of the DeserializationError class.
# @param [String] message message the human readable description of error.
# @param [String] exception_message the inner exception stacktrace.
# @param [String] exception_stacktrace the inner exception stacktrace.
# @param [MsRest::HttpOperationResponse] the request and response
def initialize(msg, exception_message, exception_stacktrace, result)
@msg = msg || self.class.name
@exception_message = exception_message
@exception_stacktrace = exception_stacktrace
@result = result
end
def to_json(*a)
{exception_message: exception_message, message: @msg, stacktrace: exception_stacktrace, result: result}.to_json(*a)
end
def to_s
JSON.pretty_generate(self)
end
end
end
|