You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
although possibly ugly and error prone should the effect-aws library change the constants.
Different mock frameworks will have their own behaviours, but at a fundamental level, the ability to more readily construct error types would be useful.
As an aside, the service type could be exported within the service namespace, so we can avoid the Context.Tag.Service<xxx> and have something like Service.Type. I think that effect-aws could improve the exports, to better mirror those used within effect as a whole (Effect.Service exports Default as the primary layer for example).
The text was updated successfully, but these errors were encountered:
the ResourceNotFoundError is a copy of ResourceNotFoundException (I know it is a bit wierd that it is renamed, but I though initially it would be better to make namings consistent, inspite what aws-sdk provides. But now I think it was a mistake...)
currently effect-aws copies the error and adds the _tag to it, I know it is not perfect, I'd rather keep the error instances original and add _tag in prototype: this gives benefit of using instanceof on errors as they stay native..
we can avoid the Context.Tag.Service and have something like Service.Type.
I also noticed inconviniece with that, agree, it is good to improve
I think that effect-aws could improve the exports, to better mirror those used within effect
Also agree, effect-aws was written before this service Default was introduced. in fact it is not using the Service data structure. Can be improved too..
Errors are exposed only as types, which means that its not easy to create mocks for the AWS services. Example for jest/jest-mock-extended:
Usability could be vastly improved by providing a constructor for the error, with some possible optimisation to provide sensible defaults, eg.:
One could apply a kludge such as:
although possibly ugly and error prone should the effect-aws library change the constants.
Different mock frameworks will have their own behaviours, but at a fundamental level, the ability to more readily construct error types would be useful.
As an aside, the service type could be exported within the service namespace, so we can avoid the
Context.Tag.Service<xxx>
and have something likeService.Type
. I think that effect-aws could improve the exports, to better mirror those used within effect as a whole (Effect.Service
exportsDefault
as the primary layer for example).The text was updated successfully, but these errors were encountered: