Skip to content
Snippets Groups Projects
Commit 8248314b authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Don't rescue Exception, but StandardError

parent a5b10196
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -15,10 +15,10 @@ module Ci
@builds = @config_processor.builds
@status = true
end
rescue Ci::GitlabCiYamlProcessor::ValidationError => e
rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e
@error = e.message
@status = false
rescue Exception
rescue
@error = "Undefined error"
@status = false
end
Loading
Loading
Loading
Loading
@@ -190,14 +190,11 @@ module Ci
def config_processor
return nil unless ci_yaml_file
@config_processor ||= Ci::GitlabCiYamlProcessor.new(ci_yaml_file, gl_project.path_with_namespace)
rescue Ci::GitlabCiYamlProcessor::ValidationError => e
rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e
save_yaml_error(e.message)
nil
rescue Psych::SyntaxError => e
save_yaml_error(e.message)
nil
rescue Exception
save_yaml_error("Undefined yaml error")
rescue
save_yaml_error("Undefined error")
nil
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment