Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
caosdb
Software
CaosDB Crawler
Commits
7d05e02f
Commit
7d05e02f
authored
7 months ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add string representation for ImpossibleMergeError
parent
58645183
No related branches found
No related tags found
2 merge requests
!184
Release 0.9.1
,
!183
F improve error messages
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caoscrawler/exceptions.py
+34
-3
34 additions, 3 deletions
src/caoscrawler/exceptions.py
with
34 additions
and
3 deletions
src/caoscrawler/exceptions.py
+
34
−
3
View file @
7d05e02f
...
...
@@ -20,6 +20,9 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
from
typing
import
Any
class
ForbiddenTransaction
(
Exception
):
"""
Thrown if an transactions is needed that is not allowed.
For example an update of an entity if the security level is INSERT
...
...
@@ -30,12 +33,40 @@ class ForbiddenTransaction(Exception):
class
ImpossibleMergeError
(
Exception
):
"""
Thrown if due to identifying information, two SyncNodes or two Properties of SyncNodes
should be merged, but there is conflicting information that prevents this.
Parameters
----------
msg : str
A case-specific error message describing where the merger error occurred.
pname : str
The name of the property the values of which caused the merge error.
value_a, value_b : Any
The two values that couldn
'
t be merged.
Attributes
----------
message : str
A case-specific error message describing where the merger error occurred.
values : tuple[Any]
The two values that couldn
'
t be merged.
pname : str
The name of the property the values of which caused the merge error.
"""
def
__init__
(
self
,
*
args
,
pname
,
value
s
,
**
kwargs
):
def
__init__
(
self
,
msg
:
str
,
pname
:
str
,
value
_a
:
Any
,
value_b
:
Any
):
self
.
pname
=
pname
self
.
values
=
values
super
().
__init__
(
self
,
*
args
,
**
kwargs
)
self
.
values
=
(
value_a
,
value_b
)
self
.
message
=
msg
super
().
__init__
(
self
,
msg
)
def
__str__
(
self
):
return
(
f
"
{
self
.
message
}
\n\n
The problematic property is
'
{
self
.
pname
}
'
with
"
f
"
values
'
{
self
.
values
[
0
]
}
'
and
'
{
self
.
values
[
1
]
}
'
.
"
)
def
__repr__
(
self
):
return
self
.
__str__
()
class
InvalidIdentifiableYAML
(
Exception
):
...
...
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