Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Raise exception to OS level for integratability #335

Closed
bobstarbird opened this issue Jan 14, 2015 · 4 comments
Closed

Raise exception to OS level for integratability #335

bobstarbird opened this issue Jan 14, 2015 · 4 comments

Comments

@bobstarbird
Copy link

Add "raise e" to ml.rb to take advantage of Ruby setting exit status so ML commands can be embedded and exit status tested externally

rescue Net::HTTPServerException => e
case e.response
when Net::HTTPUnauthorized then
@logger.error "Invalid login credentials for #{@properties["environment"]} environment!!"
raise e
else
@logger.error e
@logger.error e.response.body
raise e
end
rescue Net::HTTPFatalError => e
@logger.error e
@logger.error e.response.body
raise e
rescue DanglingVarsException => e
@logger.error "WARNING: The following configuration variables could not be validated:"
e.vars.each do |k,v|
@logger.error "#{k}=#{v}"
end
raise e
rescue HelpException => e
Help.doHelp(@logger, e.command, e.message)
raise e
rescue ExitException => e
@logger.error e
raise e
rescue Exception => e
@logger.error e
@logger.error e.backtrace
raise e
end

@dmcassel
Copy link
Collaborator

Sounds like a good idea. @paxtonhare, if you agree I'll do a PR.

@grtjn
Copy link
Contributor

grtjn commented Jan 14, 2015

+1

@paxtonhare
Copy link
Contributor

Go for it

dmcassel added a commit to dmcassel/roxy that referenced this issue Jan 15, 2015
paxtonhare added a commit that referenced this issue Jan 20, 2015
#335 adding 'raise e' so that exit statuses will be returned
@grtjn
Copy link
Contributor

grtjn commented Jan 21, 2015

Fixed in dev

@grtjn grtjn closed this as completed Jan 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants