Exception: StandardSingpass::Myinfo::ApiError

Inherits:
Error
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/standard_singpass/myinfo/error.rb

Overview

Raised for a Myinfo response we can't use, and for transport failures reaching Myinfo at all.

status carries the HTTP status when the error came from an actual response (nil for transport failures, and for errors a host application raises itself). Hosts need it to tell "Myinfo or one of its upstream agencies is unavailable" — 502/503/504, retry in a few minutes — apart from "we sent something wrong", which is a bug and warrants support contact. Parsing the status back out of message is the alternative, and it is a trap: the message is not a stable interface.

502 specifically is Singpass's documented signal that a Myinfo upstream (CPF Board, IRAS, MOM, …) is down, including during their published maintenance windows: https://docs.developer.singpass.gov.sg/docs/products/singpass-myinfo/scheduled-downtimes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status: nil) ⇒ ApiError

Returns a new instance of ApiError.



37
38
39
40
# File 'lib/standard_singpass/myinfo/error.rb', line 37

def initialize(message = nil, status: nil)
  super(message)
  @status = status
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



32
33
34
# File 'lib/standard_singpass/myinfo/error.rb', line 32

def status
  @status
end