Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
d13bee87
Commit
d13bee87
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Use XML-style brackets when reporting configuration item issues.
parent
43c621db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxCommon/Serializables/ServiceConfig.cs
+8
-8
8 additions, 8 deletions
ATxCommon/Serializables/ServiceConfig.cs
with
8 additions
and
8 deletions
ATxCommon/Serializables/ServiceConfig.cs
+
8
−
8
View file @
d13bee87
...
...
@@ -313,23 +313,23 @@ namespace ATxCommon.Serializables
// if the string is null terminate the validation immediately since this means the
// file doesn't contain a required parameter at all:
if
(
value
==
null
)
{
var
msg
=
$"mandatory parameter missing:
{
name
}
"
;
var
msg
=
$"mandatory parameter missing:
<
{
name
}
>
"
;
Log
.
Error
(
msg
);
throw
new
ConfigurationErrorsException
(
msg
);
}
if
(
string
.
IsNullOrWhiteSpace
(
value
))
return
$"mandatory parameter unset:
{
name
}
\n"
;
return
$"mandatory parameter unset:
<
{
name
}
>
\n"
;
return
string
.
Empty
;
}
string
CheckMinValue
(
int
value
,
string
name
,
int
min
)
{
if
(
value
==
0
)
return
$"
{
name
}
is unset (or set to 0), minimal accepted value is
{
min
}
\n"
;
return
$"
<
{
name
}
>
is unset (or set to 0), minimal accepted value is
{
min
}
\n"
;
if
(
value
<
min
)
return
$"
{
name
}
must not be smaller than
{
min
}
\n"
;
return
$"
<
{
name
}
>
must not be smaller than
{
min
}
\n"
;
return
string
.
Empty
;
}
...
...
@@ -337,7 +337,7 @@ namespace ATxCommon.Serializables
string
CheckLocalDrive
(
string
value
,
string
name
)
{
var
driveType
=
new
DriveInfo
(
value
).
DriveType
;
if
(
driveType
!=
DriveType
.
Fixed
)
return
$"
{
name
}
(
{
value
}
) must be a local fixed drive, not '
{
driveType
}
'!\n"
;
return
$"
<
{
name
}
>
(
{
value
}
) must be a local fixed drive, not '
{
driveType
}
'!\n"
;
return
string
.
Empty
;
}
...
...
@@ -374,14 +374,14 @@ namespace ATxCommon.Serializables
// SourceDrive
if
(
c
.
SourceDrive
.
Substring
(
1
)
!=
@":\"
)
errmsg
+=
"SourceDrive must be of form [X:\\]\n!"
;
errmsg
+=
"
<
SourceDrive
>
must be of form [X:\\]\n!"
;
errmsg
+=
CheckLocalDrive
(
c
.
SourceDrive
,
nameof
(
c
.
SourceDrive
));
// spooling directories: IncomingDirectory + ManagedDirectory
if
(
c
.
IncomingDirectory
.
StartsWith
(
@"\"
))
errmsg
+=
"IncomingDirectory must not start with a backslash!\n"
;
errmsg
+=
"
<
IncomingDirectory
>
must not start with a backslash!\n"
;
if
(
c
.
ManagedDirectory
.
StartsWith
(
@"\"
))
errmsg
+=
"ManagedDirectory must not start with a backslash!\n"
;
errmsg
+=
"
<
ManagedDirectory
>
must not start with a backslash!\n"
;
// DestinationDirectory
if
(!
Directory
.
Exists
(
c
.
DestinationDirectory
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment