Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ECSS Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AcubeSat-OBC
ECSS Services
Commits
cb7e6c9c
Commit
cb7e6c9c
authored
6 years ago
by
Theodoros Katzalis
Browse files
Options
Downloads
Patches
Plain Diff
Use a more suitable error message
parent
69a8e309
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inc/ErrorHandler.hpp
+5
-0
5 additions, 0 deletions
inc/ErrorHandler.hpp
src/Helpers/TimeAndDate.cpp
+6
-6
6 additions, 6 deletions
src/Helpers/TimeAndDate.cpp
with
11 additions
and
6 deletions
inc/ErrorHandler.hpp
+
5
−
0
View file @
cb7e6c9c
...
@@ -56,6 +56,11 @@ public:
...
@@ -56,6 +56,11 @@ public:
* An error in the header of a packet makes it unable to be parsed
* An error in the header of a packet makes it unable to be parsed
*/
*/
UnacceptablePacket
=
5
,
UnacceptablePacket
=
5
,
/**
* A date that isn't valid according to Gregorian calendar (the well-known civil calendar)
*/
InvalidDate
=
6
,
};
};
/**
/**
...
...
This diff is collapsed.
Click to expand it.
src/Helpers/TimeAndDate.cpp
+
6
−
6
View file @
cb7e6c9c
...
@@ -16,12 +16,12 @@ TimeAndDate::TimeAndDate(uint16_t year, uint8_t month, uint8_t day, uint8_t hour
...
@@ -16,12 +16,12 @@ TimeAndDate::TimeAndDate(uint16_t year, uint8_t month, uint8_t day, uint8_t hour
// check if the parameters makes sense
// check if the parameters makes sense
// @todo change the condition of the assertion for the \p year
// @todo change the condition of the assertion for the \p year
assertI
(
2019
<=
year
<
2025
,
ErrorHandler
::
InternalErrorType
::
UnknownInternalError
);
assertI
(
2019
<=
year
<
2025
,
ErrorHandler
::
InternalErrorType
::
InvalidDate
);
assertI
(
1
<=
month
<=
12
,
ErrorHandler
::
InternalErrorType
::
UnknownInternalError
);
assertI
(
1
<=
month
<=
12
,
ErrorHandler
::
InternalErrorType
::
InvalidDate
);
assertI
(
1
<=
day
<=
31
,
ErrorHandler
::
InternalErrorType
::
UnknownInternalError
);
assertI
(
1
<=
day
<=
31
,
ErrorHandler
::
InternalErrorType
::
InvalidDate
);
assertI
(
0
<=
hour
<=
24
,
ErrorHandler
::
InternalErrorType
::
UnknownInternalError
);
assertI
(
0
<=
hour
<=
24
,
ErrorHandler
::
InternalErrorType
::
InvalidDate
);
assertI
(
0
<=
minute
<=
60
,
ErrorHandler
::
InternalErrorType
::
UnknownInternalError
);
assertI
(
0
<=
minute
<=
60
,
ErrorHandler
::
InternalErrorType
::
InvalidDate
);
assertI
(
0
<=
second
<=
60
,
ErrorHandler
::
InternalErrorType
::
UnknownInternalError
);
assertI
(
0
<=
second
<=
60
,
ErrorHandler
::
InternalErrorType
::
InvalidDate
);
this
->
year
=
year
;
this
->
year
=
year
;
this
->
month
=
month
;
this
->
month
=
month
;
...
...
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