improved ContractError; captures stacktrace if available