File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 20
20
TransientSyncException ,
21
21
)
22
22
from authentik .lib .sync .outgoing .models import OutgoingSyncProvider
23
+ from authentik .lib .utils .errors import exception_to_dict
23
24
from authentik .lib .utils .reflection import class_to_path , path_to_class
24
25
from authentik .tasks .models import Task
25
26
@@ -164,16 +165,17 @@ def sync_objects(
164
165
except BadRequestSyncException as exc :
165
166
self .logger .warning ("failed to sync object" , exc = exc , obj = obj )
166
167
task .warning (
167
- f"Failed to sync { obj . _meta . verbose_name } { str (obj )} due to error: { str (exc )} " ,
168
+ f"Failed to sync { str (obj )} due to error: { str (exc )} " ,
168
169
arguments = exc .args [1 :],
169
170
obj = sanitize_item (obj ),
171
+ exception = exception_to_dict (exc ),
170
172
)
171
173
except TransientSyncException as exc :
172
174
self .logger .warning ("failed to sync object" , exc = exc , user = obj )
173
175
task .warning (
174
- f"Failed to sync { obj ._meta .verbose_name } { str (obj )} due to "
175
- f"transient error: { str (exc )} " ,
176
+ f"Failed to sync { str (obj )} due to " f"transient error: { str (exc )} " ,
176
177
obj = sanitize_item (obj ),
178
+ exception = exception_to_dict (exc ),
177
179
)
178
180
except StopSync as exc :
179
181
self .logger .warning ("Stopping sync" , exc = exc )
Original file line number Diff line number Diff line change @@ -27,3 +27,8 @@ def detail(self) -> str:
27
27
except ValidationError :
28
28
pass
29
29
return self ._message
30
+
31
+ def __str__ (self ):
32
+ if self ._response :
33
+ return self ._response .text
34
+ return super ().__str__ ()
You can’t perform that action at this time.
0 commit comments