Closed debug-ito closed 1 year ago
Is this a regression, or have you only ever used amazonka-2.0 from main
?
I use the version with 2.0.0-rc1
tag (commit 0ccede621e56fb6f240e4850e205cde82d0e4a4b). I've never tested any other version.
Note that when I used 2.0.0-rc1
between Feb and Apr 2022, it worked fine. So, I suspect there has been some changes in AWS REST API.
I believe you are right. Can you try using your own _MatchServiceError
call to construct a prism as workaround:
_ResourceNotFoundException = _MatchServiceError defaultService "ResourceNotFoundException:http://iot.amazonaws.com/doc/2015-10-02/" . hasStatus 404`
I will have to see if the generator can be taught to emit this suffix on the error codes, or maybe we change the hasErrorCode
matcher to match prefixes instead of using (==)
?
Thanks for suggestion. I tried your workaround, using _MatchServiceError
to make a fixed version of _ResourceNotFoundException
, and it worked fine. It successfully caught the exception.
I will have to see if the generator can be taught to emit this suffix on the error codes
That would be the best. I hope this change in AWS REST API is documented somewhere...
maybe we change the hasErrorCode matcher to match prefixes instead of using
(==)
I think that makes sense. Or, we can even use isInfixOf
.
boto3 splits colons away when parsing an error code out of a response header - we should do the same.
I use amazonka-iot from amazonka-2.0.0-rc1 (commit 0ccede621e56fb6f240e4850e205cde82d0e4a4b).
I ran something like the expression below.
The expectation was that "not-present" Thing did not exist, so the
ResourceNotFoundException
was thrown, caught and converted toLeft
. However, the exception was not caught. It's likeI suspect that the
_ResourceNotFoundException
could not match_serviceErrorCode = ErrorCode "ResourceNotFoundException:http://iot.amazonaws.com/doc/2015-10-02/"
.