mahsoud / boar

Automatically exported from code.google.com/p/boar
0 stars 0 forks source link

Handle AssertionError: Offset must be given without ending slash. automatically #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
At the moment, when importing a direction, if the offset contains a trailing 
slash, boar checks and detects this and presents: 

AssertionError: Offset must be given without ending slash. Was: ./whatever/

If boar is detecting this, why not just strip the trailing slash and continue 
the operation? Terminating the entire operation *after* doing all the heavy io 
of scanning the directory is the best user experience.

If there's some rational for not automatically catching and handling the 
trailing slash on offsets, the condition should absolutely be checked *before* 
recursing into the directory and letting the user watch the (very nice btw :) 
progress output, and 1h later have boar barf on a trailing / and force the user 
to rerun the import and have boar redo all the work it just finished doing.

In general, errors that cause boar to terminate should be detected as early in 
the process as possible to give the user the opportunity to address them and 
try again.

Even errors that have to be detected after something like a potentially lengthy 
scan should present the user the option to interactively resolve them if at all 
possible (rather than forcing them to rerun a scan if it can be avoided).

For instance, if boar hits a file read error, even if --ignore-errors isn't 
set, boar can present a prompt to ask the user if they want to continue anyway 
(setting --ignore-errors after the fact). 

I realize if boar is being run from a script often the desired behavior is to 
have a program fail, so prompts like that can be limited to cases where boar is 
being run interactively from the commandline.

Just my two cents :)

Original issue reported on code.google.com by cryptob...@gmail.com on 29 Feb 2012 at 12:55

GoogleCodeExporter commented 9 years ago
when importing a directory*

Original comment by cryptob...@gmail.com on 29 Feb 2012 at 12:55

GoogleCodeExporter commented 9 years ago
isn't* the best user experience

Original comment by cryptob...@gmail.com on 29 Feb 2012 at 12:56

GoogleCodeExporter commented 9 years ago
Certainly. The assertion error is a stopgap check in the bowels of boar, there 
should be an early user friendly check of CLI arguments as well. (Well, there 
are, but it apparently failed for some reason)

Original comment by ekb...@gmail.com on 29 Feb 2012 at 1:00

GoogleCodeExporter commented 9 years ago
Fixed in changeset cc76bd4d956e.

Original comment by ekb...@gmail.com on 21 May 2012 at 7:03

GoogleCodeExporter commented 9 years ago
This issue was closed by revision cc76bd4d956e.

Original comment by ekb...@gmail.com on 21 May 2012 at 7:04

GoogleCodeExporter commented 9 years ago

Original comment by ekb...@gmail.com on 21 May 2012 at 10:41