-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adding storage client #191
Conversation
0929090
to
d4c5255
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just clearing this off of my review list for now, please add me again when it's ready for 👀 !
e1a078e
to
1237012
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No API concerns just some questions / minor issues
/** | ||
* Item with specified name doesn't exist | ||
*/ | ||
public const ITEM_NOT_FOUND_ERROR = "ITEM_NOT_FOUND_ERROR"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should call this STORE_ITEM...
to disambiguate vs cache items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no not found error for cache items-- those are represented as misses. This is also how this is defined in the JS SDK. I'm not necessarily opposed to changing this error code to be specific to storage for future-proofing, but we should be consistent across SDKs. I'm going to leave this for now to maintain consistency with other SDKs but am happy to discuss further.
/** | ||
* Item with specified name doesn't exist | ||
*/ | ||
class ItemNotFoundError extends SdkError | ||
{ | ||
public string $errorCode = MomentoErrorCode::ITEM_NOT_FOUND_ERROR; | ||
public string $messageWrapper = 'An item with the specified name does not exist. To resolve this error, make sure you have created the item before attempting to use it'; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename should extend here too.
public function type(): string | ||
{ | ||
throw $this->innerException(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we throwing exceptions here vs returning null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I wasn't sure how far to take this. Same question applies to found()
as well, which makes sense as both null
and false
in the error class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched it so both type()
and found()
return null
from the error class.
No description provided.