Skip to content
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

StorageObject#toString throws for pre-upload objects #19

Open
chrylis opened this issue Feb 27, 2024 · 0 comments
Open

StorageObject#toString throws for pre-upload objects #19

chrylis opened this issue Feb 27, 2024 · 0 comments

Comments

@chrylis
Copy link

chrylis commented Feb 27, 2024

When creating a new object to pass to putObject, the object has no metadata for the date. However, calling toString() invokes getLastModifiedDate(), which invokes getDate(), which throws IllegalArgumentException (which should really be IllegalStateException) if no date is set. This means that trying to log an object pre-upload causes an exception.

Since toString() should never throw an exception, it should either omit lastModified or inspect it in a null-safe manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant