-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PL-24913]: Handle the error raised while creating a multipart input (#…
…181)
- Loading branch information
1 parent
5a5c5ca
commit 7664143
Showing
4 changed files
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package stash | ||
|
||
import "mime/multipart" | ||
|
||
type MultipartWriter struct { | ||
Writer *multipart.Writer | ||
Error error | ||
} | ||
|
||
func (mw *MultipartWriter) Write(f, v string) { | ||
if mw.Error != nil { | ||
return | ||
} | ||
if v == "" { | ||
return | ||
} | ||
mw.Error = mw.Writer.WriteField(f, v) | ||
} | ||
|
||
func (mw *MultipartWriter) Close() { | ||
mw.Writer.Close() | ||
} | ||
|
||
func (mw *MultipartWriter) FormDataContentType() string { | ||
return mw.Writer.FormDataContentType() | ||
} |
This file contains 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