[master 11/13] Use DeviceFormatError and FormatResizeError in DeviceFormat