Add an output message to function

The message includes the solution, the output flag indicating if the
solution was found, and a descriptive message indicating if an error was
found.