]> git.sven.stormbind.net Git - sven/tclcurl.git/blobdiff - tests/errorBuffer.tcl
Imported Upstream version 7.19.6
[sven/tclcurl.git] / tests / errorBuffer.tcl
diff --git a/tests/errorBuffer.tcl b/tests/errorBuffer.tcl
new file mode 100755 (executable)
index 0000000..e90896c
--- /dev/null
@@ -0,0 +1,23 @@
+package require TclCurl
+
+set curlHandle [curl::init]
+$curlHandle configure -url "Shire.Asturias.com" -errorbuffer errorMsg
+
+if {[catch {$curlHandle perform}]} {
+       puts "The error message: $errorMsg"
+}
+
+$curlHandle configure -url "Shire.Asturias.com" -errorbuffer error(msg)
+
+if {[catch {$curlHandle perform}]} {
+       puts "The error message: $error(msg)"
+}
+
+$curlHandle cleanup
+
+unset error
+catch {curl::transfer -url "Shire.Asturias.com" -errorbuffer error(msg)}
+
+puts "Error: $error(msg)"
+
+