Skip to content

Commit db056d1

Browse files
committed
web: add checked flag to WebClient.resIn
1 parent b907929 commit db056d1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/web/fan/WebClient.fan

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,11 @@ class WebClient
149149
**
150150
** Also see convenience methods: `resStr` and `resBuf`.
151151
**
152-
InStream resIn()
152+
InStream? resIn(Bool checked := true)
153153
{
154-
if (resInStream == null) throw IOErr("No input stream for response $resCode")
155-
return resInStream
154+
if (resInStream != null) return resInStream
155+
if (checked) throw IOErr("No input stream for response $resCode")
156+
return null
156157
}
157158

158159
**

0 commit comments

Comments
 (0)