swc-678 - better error handling