Open
Conversation
stnguyen90
reviewed
Oct 3, 2024
Contributor
stnguyen90
left a comment
There was a problem hiding this comment.
can we rely on the error type instead of the error message?
loks0n
requested changes
Oct 4, 2024
| val chunksUploaded = current["chunksUploaded"] as Long | ||
| offset = chunksUploaded * CHUNK_SIZE | ||
| } catch (e: Exception) { | ||
| if (e.message != null && !e.message!!.contains("file could not be found")) { |
Member
There was a problem hiding this comment.
Agree with Steven, this seems fragile...
| offset = chunksUploaded * CHUNK_SIZE | ||
| } catch (e: Exception) { | ||
| if (e.message != null && !e.message!!.contains("file could not be found")) { | ||
| throw e |
Member
There was a problem hiding this comment.
Doesn't call() methods already throw these exceptions, is there any need to catch and throw here?
| @@ -304,13 +308,13 @@ module {{ spec.title | caseUcfirst }} | |||
| when Hash then value.map { |k,v| encode(v, append_key(key,k)) }.join('&') | |||
| when Array then value.map { |v| encode(v, "#{key}[]") }.join('&') | |||
| when nil then '' | |||
Member
There was a problem hiding this comment.
Unrelated, but can we fix the spacing here? Looks weird
| params = emptyMap(), | ||
| responseType = Map::class.java, | ||
| ) | ||
| val chunksUploaded = current["chunksUploaded"] as Long |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fix chunk uploads with predefined ID for
Test Plan
Running these code snippets.
Kotlin
Ruby
aaa.mp4is bigger than 10MB.Related PRs and Issues
#963
Have you read the [Contributing Guidelines on issues]
Yes