refactor SOS try catch block in solver.jl