enhanced function error/debug output