Skip to content

Commit

Permalink
DataScraping: More sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Jan 6, 2025
1 parent 3db134d commit a140776
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DataScraping/XML/ItemSources.pas
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ interface

protected constructor(name: TSourceName);
begin
if name=nil then
raise nil;
self._name := name;
if name in all_sources then
raise new InvalidOperationException($'Added {self} multiple times');
Expand Down
3 changes: 3 additions & 0 deletions DataScraping/XML/OpenCL/ScrapXML.pas
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@
end;
if throw_away then exit;

if gr_name=nil then
raise new InvalidOperationException($'<require> node with etype="{etype}" had no group attribute:{#10}{n.FullXmlText}');

var gr_s := FindOrMakeSource(gr_name, nil);
if gr_s<>nil then
begin
Expand Down
2 changes: 2 additions & 0 deletions Utils/ThoroughXML.pas
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ interface
public property Tag: string read _raw.Name;
public property Text: string read GetContent(()->_raw.InnerText);

public property FullXmlText: string read _raw.OuterXml;

public function IterateParents: sequence of XmlNode;
begin
var curr := self;
Expand Down

0 comments on commit a140776

Please sign in to comment.