Skip to content

Commit

Permalink
adds InvalidSetupError to indicate errors that can be ignored safely
Browse files Browse the repository at this point in the history
  • Loading branch information
sadit committed Jul 30, 2022
1 parent 2439578 commit e5301eb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SearchModels"
uuid = "0e966ebe-b704-4a65-8279-db954bfe5da0"
authors = ["Eric S. Tellez"]
version = "0.3.1"
version = "0.3.2"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
9 changes: 9 additions & 0 deletions src/SearchModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

module SearchModels

struct InvalidSetupError <: Exception
cfg::Any
msg::String
end

export InvalidSetupError

Base.showerror(io::IO, e::InvalidSetupError) = print(io, e.msg, e.cfg)

include("utils.jl")
include("search.jl")

Expand Down
6 changes: 5 additions & 1 deletion src/search.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ function evaluate_queue(errfun::Function, evalqueue, population, parallel, tmp)
p = errfun(c)
push!(population, c => p)
catch e
@info e
@info "ignoring configuration due to exception"
if e isa InvalidSetupError
showerror(stderr, e)
else
showerror(stderr, e, catch_backtrace())
end
end
end

Expand Down

2 comments on commit e5301eb

@sadit
Copy link
Owner Author

@sadit sadit commented on e5301eb Jul 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/65334

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.2 -m "<description of version>" e5301ebabcd9151a658f19ec18589b0d15bfc6d6
git push origin v0.3.2

Please sign in to comment.