Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/server/routes/config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,10 @@ function _read_primers()
try
PrimersLibrary.load(_primers_path())
catch e
@error "primers.yml is not readable" path=_primers_path() exception=(e, catch_backtrace())
# @warn, not @error: the 400 on the next line is this function's own verdict
# that an unreadable config/primers.yml is an operator-fixable input, not a
# server fault. See the matching note in routes/databases.jl.
@warn "primers.yml is not readable" path=_primers_path() reason=sprint(showerror, e)
json_error(400, "primers_unreadable",
"config/primers.yml cannot be read as a primers document and must be repaired by hand: $(sprint(showerror, e))")
end
Expand Down
8 changes: 7 additions & 1 deletion src/server/routes/databases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ function _read_databases()
try
DatabasesLibrary.load(_databases_path())
catch e
@error "databases.yml is not readable" path=_databases_path() exception=(e, catch_backtrace())
# @warn, not @error: the 400 on the next line is this function's own verdict
# that an unreadable config/databases.yml is an operator-fixable input, not a
# server fault. Error severity with a backtrace reports a routine bad file as
# a crash. The reason is kept -- it is what names the YAML defect -- and only
# the backtrace goes, which pointed into YAML.jl's parser, never at the
# offending line.
@warn "databases.yml is not readable" path=_databases_path() reason=sprint(showerror, e)
json_error(400, "databases_unreadable",
"config/databases.yml cannot be read as a databases document and must be repaired by hand: $(sprint(showerror, e))")
end
Expand Down
Loading