ptx: return meaningful error codes.