Extract error message from TSort::Cyclic and print

Also updated test case to include check on error message