[m-rev.] for review: more specific errors when file sizes exceed maximum buffer sizes

Peter Wang novalazy at gmail.com
Mon Oct 28 16:14:05 AEDT 2019


On Mon, 28 Oct 2019 15:49:21 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
> 
> Hi Peter,
> 
> On Mon, 28 Oct 2019, Peter Wang wrote:
> 
> > On Mon, 28 Oct 2019 13:33:25 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
> >>
> >>> On second thought, why throw an exception instead of returning an error?
> >>
> >> Doing so would break the existing interface; there isn't currently a
> >> slot to return such an error.
> >
> > I think io.error is fine.
> 
> I've split this diff, handling read_file_as_string is going to be a bit
> more complicated than I initially thought.  The revised diff below is
> for read_binary_file_as_bitmap, except taht it now returns an error
> when the buffer overflows, rather than throwing an exception.

That's fine.

Peter


More information about the reviews mailing list