Prepare error callback logic by wrapping TCCState struct