1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 19:50:22 +00:00
QB64-PE/tests/compile_tests/http/http_error.bas
Matthew Kilgore 445408d95b _StatusCode() should give the correct error on invalid handle type
Passing a handle of the invalid type (Ex. TCP) to _StatusCode should
give error 52, but it gies error 9.
2022-11-20 04:38:03 -05:00

20 lines
411 B
QBasic

$Unstable:Http
$Console:Only
ON ERROR GOTO errorhand
' This domain isn't valid at all, an error is triggered
h& = _OpenClient("https://thisisabaddomain")
Print h&
' This gives back a 404, but the connection is still successful in that
' situation.
h& = _OpenClient("https://www.example.com/unknownUrl")
Print h&
Print _StatusCode(h&)
System
errorhand:
PRINT "Error:"; ERR; ", Line:"; _ERRORLINE
RESUME NEXT