Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Weblate
gajim
Commits
e2a511b3
Commit
e2a511b3
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
inform user when databas is malformed. Fixes #4428
parent
72f30bd8
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
src/common/connection_handlers.py
+24
-0
24 additions, 0 deletions
src/common/connection_handlers.py
with
24 additions
and
0 deletions
src/common/connection_handlers.py
+
24
−
0
View file @
e2a511b3
...
...
@@ -1837,6 +1837,12 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
subject
=
subject
)
except
exceptions
.
PysqliteOperationalError
,
e
:
self
.
dispatch
(
'
ERROR
'
,
(
_
(
'
Disk Write Error
'
),
str
(
e
)))
except
exceptions
.
DatabaseMalformed
:
pritext
=
_
(
'
Database Error
'
)
sectext
=
_
(
'
The database file (%s) cannot be read. Try to repair
'
'
it or remove it (all history will be lost).
'
)
%
\
common
.
logger
.
LOG_DB_PATH
self
.
dispatch
(
'
ERROR
'
,
(
pritext
,
sectext
))
self
.
dispatch
(
'
MSGERROR
'
,
(
frm
,
msg
.
getErrorCode
(),
error_msg
,
msgtxt
,
tim
,
session
))
...
...
@@ -1877,6 +1883,12 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
gajim
.
logger
.
write
(
'
gc_msg
'
,
frm
,
msgtxt
,
tim
=
tim
)
except
exceptions
.
PysqliteOperationalError
,
e
:
self
.
dispatch
(
'
ERROR
'
,
(
_
(
'
Disk Write Error
'
),
str
(
e
)))
except
exceptions
.
DatabaseMalformed
:
pritext
=
_
(
'
Database Error
'
)
sectext
=
_
(
'
The database file (%s) cannot be read. Try to repair
'
'
it or remove it (all history will be lost).
'
)
%
\
common
.
logger
.
LOG_DB_PATH
self
.
dispatch
(
'
ERROR
'
,
(
pritext
,
sectext
))
def
dispatch_invite_message
(
self
,
invite
,
frm
):
item
=
invite
.
getTag
(
'
invite
'
)
...
...
@@ -2059,6 +2071,12 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
gajim
.
logger
.
write
(
'
gcstatus
'
,
who
,
st
,
show
)
except
exceptions
.
PysqliteOperationalError
,
e
:
self
.
dispatch
(
'
ERROR
'
,
(
_
(
'
Disk Write Error
'
),
str
(
e
)))
except
exceptions
.
DatabaseMalformed
:
pritext
=
_
(
'
Database Error
'
)
sectext
=
_
(
'
The database file (%s) cannot be read. Try to
'
'
repair it or remove it (all history will be lost).
'
)
%
\
common
.
logger
.
LOG_DB_PATH
self
.
dispatch
(
'
ERROR
'
,
(
pritext
,
sectext
))
if
avatar_sha
or
avatar_sha
==
''
:
if
avatar_sha
==
''
:
# contact has no avatar
...
...
@@ -2178,6 +2196,12 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
gajim
.
logger
.
write
(
'
status
'
,
jid_stripped
,
status
,
show
)
except
exceptions
.
PysqliteOperationalError
,
e
:
self
.
dispatch
(
'
ERROR
'
,
(
_
(
'
Disk Write Error
'
),
str
(
e
)))
except
exceptions
.
DatabaseMalformed
:
pritext
=
_
(
'
Database Error
'
)
sectext
=
_
(
'
The database file (%s) cannot be read. Try to
'
'
repair it or remove it (all history will be lost).
'
)
%
\
common
.
logger
.
LOG_DB_PATH
self
.
dispatch
(
'
ERROR
'
,
(
pritext
,
sectext
))
our_jid
=
gajim
.
get_jid_from_account
(
self
.
name
)
if
jid_stripped
==
our_jid
and
resource
==
self
.
server_resource
:
# We got our own presence
...
...
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