We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f54e923 commit 1c13adfCopy full SHA for 1c13adf
lib/didkit/plc_operation.rb
@@ -16,10 +16,12 @@ class FormatError < StandardError
16
17
def initialize(json)
18
@json = json
19
+ raise FormatError, "Expected argument to be a Hash, got a #{json.class}" unless @json.is_a?(Hash)
20
+
21
@seq = json['seq']
22
@did = json['did']
23
raise FormatError, "Missing DID: #{json}" if @did.nil?
- raise FormatError, "Invalid DID: #{@did}" unless @did.is_a?(String) && @did.start_with?('did:')
24
+ raise FormatError, "Invalid DID: #{@did.inspect}" unless @did.is_a?(String) && @did.start_with?('did:')
25
26
@cid = json['cid']
27
raise FormatError, "Missing CID: #{json}" if @cid.nil?
0 commit comments