octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Changeset] new bzip2 function


From: John W. Eaton
Subject: Re: [Changeset] new bzip2 function
Date: Mon, 12 Jan 2009 12:51:50 -0500

On  5-Jan-2009, Thorsten Meyer wrote:

| First, I had the error messages like you propose. Then I thought it
| would be quite confusing to have an error message that says "gzip: some
| error" followed by the error trace that gives "__xzip__ at line xx" and
| then "gzip at line yy".  Thinking about it again, it is probably even
| more confusing to get an error message that says "__xzip__: expecting
| argument to be this and that"  when you actually have to change the
| argument of the calling function.
| 
| Here is a list of other error messages in internal functions that do not
| reference back to the caller (and do not explain, what the problem is on
| the caller level) or do not use the "caller: " style:
| 
| scripts/general/__isequal__.m:    error ("__isequal__: list objects are
| deprecated and cannot be tested for equality here; use cell arrays
| instead");
| scripts/general/__splinen__.m:    error ("Incorrect number of arguments");
| scripts/general/__splinen__.m:    error ("%s: non gridded data or
| dimensions inconsistent", f);
| scripts/image/__img__.m:    error ("__img__: matrix is empty");
| scripts/image/__img_via_file__.m:    error ("the image viewing command
| failed");
| scripts/plot/__add_datasource__.m:    error ("internal error");
| scripts/plot/__errcomm__.m:    error ("wrong argument types");
| scripts/plot/__errcomm__.m:    error ("argument sizes do not match");
| scripts/plot/__errcomm__.m:    error ("too many arguments to a plot");
| scripts/plot/__errplot__.m:    error ("error plot requires 2, 3, 4 or 6
| columns");
| scripts/plot/__errplot__.m:    error ("error plot requires 2, 3, 4 or 6
| columns");
| scripts/plot/__gnuplot_ginput__.m:    error ("ginput: stream to gnuplot
| not open");
| scripts/plot/__go_draw_axes__.m:          error ("__go_draw_axes__:
| invalid grid data");
| scripts/plot/__go_draw_axes__.m:      error ("__go_draw_axes__: unknown
| object class, %s",
| scripts/plot/__go_draw_axes__.m:    error ("unsupported type of ticklabel");
| scripts/plot/__go_draw_figure__.m:          error ("__go_draw_figure__:
| unknown object class, %s",
| scripts/plot/__go_draw_figure__.m:      error ("__go_draw_figure__:
| expecting figure object, found `%s'",
| scripts/plot/__next_line_color__.m:      error ("__next_line_color__:
| color_rotation not initialized");
| scripts/plot/__patch__.m:    error ("patch: not supported");
| scripts/plot/__patch__.m:    error ("patch: color value not valid");
| scripts/plot/__patch__.m:    error ("patch: size of x, y, and c must be
| equal")
| scripts/plot/__plr2__.m:      error ("__plr2__: invalid data for plotting");
| scripts/plot/__plr2__.m:        error ("__plr2__: vector lengths must
| match");
| scripts/plot/__plr2__.m:        error ("__plr2__: vector and matrix
| sizes must match");
| scripts/plot/__plr2__.m:      error ("__plr2__: invalid data for plotting")
| scripts/plot/__plr2__.m:        error ("__plr2__: vector and matrix
| sizes must match");
| scripts/plot/__plr2__.m:        error ("__plr2__: matrix dimensions must
| match");
| scripts/plot/__plr2__.m:      error ("__plr2__: invalid data for plotting")
| scripts/plot/__plr2__.m:    error ("__plr2__: invalid data for plotting")
| scripts/plot/__plt1__.m:    error ("__plt1__: options must be a struct
| array");
| scripts/plot/__plt2__.m:    error ("__plt1__: options must be a struct
| array");
| scripts/plot/__plt2__.m:      error ("__plt2__: invalid data for plotting");
| scripts/plot/__plt2__.m:      error ("__plt2__: invalid data for plotting");
| scripts/plot/__plt2__.m:      error ("__plt2__: invalid data for plotting");
| scripts/plot/__plt2__.m:    error ("__plt2__: invalid data for plotting");
| scripts/plot/__plt2mm__.m:      error ("__plt2mm__: arguments must be a
| matrices");
| scripts/plot/__plt2mm__.m:    error ("__plt2mm__: matrix dimensions must
| match");
| scripts/plot/__plt2mv__.m:    error ("__plt2mv__: matrix dimensions must
| match");
| scripts/plot/__plt2mv__.m:    error ("__plt2mv__: arguments must be a
| matrices");
| scripts/plot/__plt2ss__.m:    error ("__plt2ss__: arguments must be
| scalars");
| scripts/plot/__plt2sv__.m:    error ("__plt2sv__: first arg must be
| scalar, second arg must be vector");
| scripts/plot/__plt2vm__.m:    error ("__plt2vm__: matrix dimensions must
| match");
| scripts/plot/__plt2vm__.m:    error ("__plt2vm__: arguments must be a
| matrices");
| scripts/plot/__plt2vs__.m:    error ("__plt2vs__: first arg must be
| vector, second arg must be scalar");
| scripts/plot/__plt2vv__.m:    error ("__plt2vv__: vector lengths must
| match");
| scripts/plot/__plt__.m:      error ("plot: no data to plot");
| scripts/plot/__pltopt__.m:      error ("__pltopt__: expecting argument
| to be character string or cell array of character strings");
| 
| Should those also be fixed?

I think they can be left as is if the only way these messages can be
triggered is when there is some internal usage that is wrong, because
we don't expect that to happen and if it does, there is a bug to fix
in Octave.

But if an incorrect user input to plot (for example) can cause an
error in __plt2mm__, then we should probably pass the name of the
calling function in to these internal functions and use that in the
messages.

I don't see this as a high priority project, but it would be nice to
fix if someone has time.

| The one check for correct call of __xzip__ itself is to prevent having
| equal source and target file name which may lead to a loss of data in
| some cases. I would rather leave that in.

OK.

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]