Is filing a mandamus petition necessary to preserve error for appeal

Is filing a mandamus petition necessary to preserve error for appeal?