52 |
my ($self, %opt) = @_; |
my ($self, %opt) = @_; |
53 |
|
|
54 |
my $out = $self->output; |
my $out = $self->output; |
55 |
|
$out->has_error (1); |
56 |
|
|
57 |
my $error_level = $opt{level}; |
my $error_level = $opt{level}; |
58 |
if (not defined $error_level) { |
if (not defined $error_level) { |
81 |
$error_layer = 'syntax'; ## NOTE: Unknown - an error of the implementation |
$error_layer = 'syntax'; ## NOTE: Unknown - an error of the implementation |
82 |
} |
} |
83 |
|
|
|
my $error_type_text = $opt{type}; |
|
|
|
|
84 |
my $class = qq[level-$error_level layer-$error_layer]; |
my $class = qq[level-$error_level layer-$error_layer]; |
85 |
|
|
86 |
## Line & column numbers (prepare values) |
## Line & column numbers (prepare values) |
185 |
} elsif (defined $opt{input}->{request_uri}) { |
} elsif (defined $opt{input}->{request_uri}) { |
186 |
$out->url ($opt{input}->{request_uri}); |
$out->url ($opt{input}->{request_uri}); |
187 |
$has_location = 1; |
$has_location = 1; |
188 |
} elsif (defined $opt{input}->{uri}) { |
} elsif (defined $opt{input}->url) { |
189 |
$out->url ($opt{input}->{uri}); |
$out->url ($opt{input}->url); |
190 |
$has_location = 1; |
$has_location = 1; |
191 |
} |
} |
192 |
} |
} |
193 |
|
|
194 |
unless ($has_location) { |
unless ($has_location) { |
195 |
$out->text ('Unknown location'); |
$out->nl_text ('Unknown location'); |
196 |
} |
} |
197 |
} |
} |
198 |
|
|
203 |
$out->text (': '); |
$out->text (': '); |
204 |
|
|
205 |
## Error message |
## Error message |
206 |
$out->nl_text ($error_type_text, node => $opt{node}, text => $opt{text}); |
my $error_type_text = $opt{type}; |
207 |
|
$out->nl_text ($error_type_text, node => $opt{node}, text => $opt{text}, |
208 |
## Additional error description |
value => $opt{value}); |
|
if (defined $opt{text}) { |
|
|
$out->html (' (<q>'); |
|
|
$out->text ($opt{text}); |
|
|
$out->html ('</q>)'); |
|
|
} |
|
209 |
|
|
210 |
## Link to a long description |
## Link to a long description |
211 |
|
|
213 |
$fragment =~ tr/ /-/; |
$fragment =~ tr/ /-/; |
214 |
$fragment = $out->encode_url_component ($fragment); |
$fragment = $out->encode_url_component ($fragment); |
215 |
$out->text (' ['); |
$out->text (' ['); |
216 |
$out->link ('Description', url => '../error-description#' . $fragment, |
$out->start_tag ('a', href => '../error-description#' . $fragment, |
217 |
rel => 'help'); |
rel => 'help'); |
218 |
|
$out->nl_text ('Description'); |
219 |
|
$out->end_tag ('a'); |
220 |
$out->text (']'); |
$out->text (']'); |
221 |
|
|
222 |
if ($error_level eq 'm') { |
if ($error_level eq 'm') { |
283 |
$out->start_tag ('th', colspan => 7, scope => 'col'); |
$out->start_tag ('th', colspan => 7, scope => 'col'); |
284 |
$out->nl_text ('Main document'); |
$out->nl_text ('Main document'); |
285 |
}, |
}, |
286 |
{label => 'Transfer', status => $self->{layers}->{transfer}, |
{label => 'Transfer L.', status => $self->{layers}->{transfer}, |
287 |
target => 'transfer-errors', score_base => 20, |
target => 'transfer-errors', score_base => 20, |
288 |
parent_status => $maindoc_status}, |
parent_status => $maindoc_status}, |
289 |
{label => 'Encode', status => $self->{layers}->{encode}, |
{label => 'Encode L.', status => $self->{layers}->{encode}, |
290 |
score_base => 10, |
target => 'parse-errors', score_base => 10, |
291 |
parent_status => $maindoc_status}, |
parent_status => $maindoc_status}, |
292 |
{label => 'Charset', status => $self->{layers}->{charset}, |
{label => 'Char L.', status => $self->{layers}->{charset}, |
293 |
score_base => 10, |
score_base => 10, |
294 |
parent_status => $maindoc_status}, |
parent_status => $maindoc_status}, |
295 |
{label => 'Syntax', status => $self->{layers}->{syntax}, |
{label => 'Syntax L.', status => $self->{layers}->{syntax}, |
296 |
target => 'parse-errors', score_base => 20, |
target => 'parse-errors', score_base => 20, |
297 |
parent_status => $maindoc_status}, |
parent_status => $maindoc_status}, |
298 |
{label => 'Structure', status => $self->{layers}->{structure}, |
{label => 'Structure L.', status => $self->{layers}->{structure}, |
299 |
target => 'document-errors', score_base => 20, |
target => 'document-errors', score_base => 20, |
300 |
parent_status => $maindoc_status}, |
parent_status => $maindoc_status}, |
301 |
{label => 'Semantics', status => $self->{layers}->{semantics}, |
{label => 'Semantics L.', status => $self->{layers}->{semantics}, |
302 |
score_base => 20, |
score_base => 20, |
303 |
parent_status => $maindoc_status}, |
parent_status => $maindoc_status}, |
304 |
); |
); |