retrive shell return message when error occurs