Better validation errors

15 views
Skip to first unread message

anatoly techtonik

unread,
Feb 26, 2010, 3:02:44 PM2/26/10
to Bitten
The script below seems correct.

<build xmlns:python="http://bitten.edgewall.org/tools/python"
xmlns:svn="http://bitten.edgewall.org/tools/svn">
<step id="update" description="Update source from repository">
<svn:update dir="/var/www/production"/>
</step>
<step id="test" description="Running Tests">
<sh:exec file="echo" args="Tests for WWW"/>
</step>
</build>

But it fails. The error is:
Warning: Failure parsing recipe: unbound prefix: line 7, column 4.

The reason is that sh namespace is not included. I knew what XML is
and namespaces are, but it took some time to pinpoint the problem
under affection of Friday evening syndrome. It would be useful to
transform "unbound prefix" error into something more obvious like
"unknown namespace 'sh'".

--
anatoly t.

Simon Cross

unread,
Feb 26, 2010, 3:13:34 PM2/26/10
to bit...@googlegroups.com
On Fri, Feb 26, 2010 at 10:02 PM, anatoly techtonik <tech...@gmail.com> wrote:
> But it fails. The error is:
>    Warning: Failure parsing recipe: unbound prefix: line 7, column 4.
>
> The reason is that sh namespace is not included. I knew what XML is
> and namespaces are, but it took some time to pinpoint the problem
> under affection of Friday evening syndrome. It would be useful to
> transform "unbound prefix" error into something more obvious like
> "unknown namespace 'sh'".

I agree that your suggestion would be clearer but "line 7, column 4"
already nails down the error quite firmly. If this was a simple fix
I'd be keen but the error is thrown by the XML parser Bitten uses
(xml.dom.minidom) and I don't think it's worth catching the exception
and finishing around in the XML and exception message to make things
marginally better in this one case.

Schiavo
Simon

anatoly techtonik

unread,
Mar 7, 2010, 4:49:44 AM3/7/10
to Bitten
On Feb 26, 10:13 pm, Simon Cross <hodges...@gmail.com> wrote:
>
> I agree that your suggestion would be clearer but "line 7, column 4"
> already nails down the error quite firmly. If this was a simple fix
> I'd be keen but the error is thrown by the XML parser Bitten uses
> (xml.dom.minidom) and I don't think it's worth catching the exception
> and finishing around in the XML and exception message to make things
> marginally better in this one case.

Significantly better! There is no line counters in recipe editor, so
you would have to count lines by hand. That's not a trivial task,
because what you see is not what you get - one line in minidom may be
equal to several wrapped lines in textarea. No notepad or wordpad for
windows have line counters, and I don't remember how to turn them on
in Vim either. So it is not superb at all from user perspective -
wasting time counting lines instead of concentrating on a real
problems.

The whole logic doesn't seem too complicated:
catch
match
replace
rethrow
(optionally): jQuery can catch line numbers and highlight them in
textarea.

Google Closure JS library can be of great help in designing such
component.
--
anatoly t.

potter

unread,
Mar 8, 2010, 8:35:26 AM3/8/10
to Bitten
Re: notepad

If you turn off Word-Wrap, then you can turn on the Status-Bar. With
the status bar on one can see what line and column your on.


Re: vim

I know it can be done, but I never do it. If I want to go to a
specific line I type the line number and then press 'G' (think go).
Example, to jump to line 32, type "32G". 'G' without a number prefix
takes you to the end of the file.

anatoly techtonik

unread,
Apr 23, 2010, 8:03:20 AM4/23/10
to Bitten
On Mar 8, 4:35 pm, potter <potter2...@gmail.com> wrote:
> Re: notepad
>
> If you turn off Word-Wrap, then you can turn on the Status-Bar.  With
> the status bar on one can see what line and column your on.

Either MS programmers are lazy or Notepad is magic. I use Notepad only
when Mercurial pops it up, using editor from Far Manager for all other
stuff, so there little chance for me to discover the fact.

> Re: vim
>
> I know it can be done, but I never do it.  If I want to go to a
> specific line I type the line number and then press 'G' (think go).
> Example, to jump to line 32, type "32G".  'G' without a number prefix
> takes you to the end of the file.

It is "Alt-F8, 32, Enter" dialog box in Far, but the line information
is always present. Although I've never tried to discover editing in
wrapped line mode, so it may happen that there is just no such
ability, but there is a wrapped view that can be switched on/off with
F6.


Anti offtopic: http://bitten.edgewall.org/ticket/563

--
You received this message because you are subscribed to the Google Groups "Bitten" group.
To post to this group, send email to bit...@googlegroups.com.
To unsubscribe from this group, send email to bitten+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bitten?hl=en.

Olemis Lang

unread,
Apr 23, 2010, 8:29:33 AM4/23/10
to bit...@googlegroups.com
On Sun, Mar 7, 2010 at 4:49 AM, anatoly techtonik <tech...@gmail.com> wrote:
> On Feb 26, 10:13 pm, Simon Cross <hodges...@gmail.com> wrote:
>>
>> I agree that your suggestion would be clearer but "line 7, column 4"
>> already nails down the error quite firmly. If this was a simple fix
>> I'd be keen but the error is thrown by the XML parser Bitten uses
>> (xml.dom.minidom) and I don't think it's worth catching the exception
>> and finishing around in the XML and exception message to make things
>> marginally better in this one case.
>
> Significantly better! There is no line counters in recipe editor, so
> you would have to count lines by hand. That's not a trivial task,
> because what you see is not what you get - one line in minidom may be
> equal to several wrapped lines in textarea. No notepad or wordpad for
> windows have line counters,

That's why I use either vim , Notepad++ or UltraEdit
;o)

> and I don't remember how to turn them on
> in Vim either.

theres no need to . just type

<n> gg where n is the line number (e.g. in this case 7 gg )

> So it is not superb at all from user perspective -
> wasting time counting lines instead of concentrating on a real
> problems.
>

... but I get the idea, and you're right
;o)

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
TracRpc: API v2: Fixing regression in dummy protocol providers -
http://bitbucket.org/osimons/trac-rpc-mq/changeset/807e2c73b6ec
Reply all
Reply to author
Forward
0 new messages