Plugin not catching exceptions

4 views
Skip to first unread message

Sylvain Avril

unread,
Jan 29, 2010, 12:41:13 PM1/29/10
to puppet...@googlegroups.com
Hello,

I'm writing a plugin which make an xml-rpc call that throw an
exception if the foreign call fail (due to a bad fault-structure).
So I catch this exception in my code (I expect it to fail) :
[...]
server = XMLRPC::Client.new( host, "/xmlrpc/db", 8069)
begin
result = server.call("change_admin_password", oldPassword, newPassword)
rescue Exception => e
result = 0
end
return result
[...]

When i try to execute this on the target server, I get this error :
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: wrong fault-structure: {..., line 45, in check_super\n
raise Exception('AccessDenied')\nException: AccessDenied\n"} at
/etc/puppet/modules/...

When I execute the RPC call in a standalone ruby script, it work as expected.

Is there a limitation to catching exception with plugins ?
I'm a ruby beginner, may be there's a stupid mistake.

Thanks

Reply all
Reply to author
Forward
0 new messages