Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Curl/Curb - Adding an on_debug handler causes an exit code of "1"?

Thread Tools

Curl/Curb - Adding an on_debug handler causes an exit code of "1"?

Rob Foxworthington
Posts: n/a
Using the very handy Curb from <>...

Maybe I'm doing something wrong, but it seems that the mere presence
of an on_debug handler causes the exit code of a script to be "1"
instead of "0".

Unfortunately my C skills are non-existent, so I don't understand
Curb's sources. The best I can do is provide this simple test case in

$ cat exit_code.rb
require "curl"
curl = ""

$ ruby exit_code.rb ; echo $?

$ cat exit_code_on_debug.rb
require "curl"
curl = ""
curl.on_debug { |type, data| true }

$ ruby exit_code_on_debug.rb ; echo $?

Using Curb 0.1.4, tried the above on Mac OS X 10.4 (ruby 1.8.6, curl
7.17.0) and CentOS 5 (ruby 1.8.5, curl 7.15.5)... same results.

Any hints, workaround, etc very much appreciated. -- Thanks!

Background: I have some Rake tasks that call code involving Curl/Curb
with an on_debug handler attached (used to capture "Cookie:" headers
added by libcurl's cookie engine). After the Curl/Curb stuff is
called, the exit code is "1" and Rake aborts, preventing follow-up
tasks from running.

Reply With Quote
Rob Foxworthington
Posts: n/a
Follow-up: Upgrading to Ruby 1.8.6p110 seems to fix the problem.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I get the exit code "n" passed to sys.exit(n) ? Yujo Python 2 04-10-2007 08:35 PM
Exit code of a batch (using exit /B) Joe Smith Java 4 11-08-2006 12:25 PM
Code to Exit Web App and Exit Internet Explorer =?Utf-8?B?U2FuZHk=?= ASP .Net 7 08-05-2005 01:55 AM
exit after process exit Python 2 05-31-2005 08:11 PM
Code causes segfault on exit James Leddy C Programming 7 10-16-2003 09:07 AM