diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index c133b9a6c..95f377f69 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -150,6 +150,14 @@ public function create( return new DataResponse($this->serializeArray($circle)); } catch (Exception $e) { + $this->e( + $e, [ + 'emulated' => $emulated, + 'name' => $name, + 'members' => $personal, + 'local' => $local + ] + ); throw new OcsException($e->getMessage(), $e->getCode()); } } @@ -169,6 +177,7 @@ public function destroy(string $emulated, string $circleId): DataResponse { return new DataResponse($this->serializeArray($circle)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId]); throw new OcsException($e->getMessage(), $e->getCode()); } } @@ -202,6 +211,14 @@ public function memberAdd(string $emulated, string $circleId, string $userId, in return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e( + $e, [ + 'emulated' => $emulated, + 'circleId' => $circleId, + 'userId' => $userId, + 'type' => $type + ] + ); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -230,6 +247,15 @@ public function memberLevel(string $emulated, string $circleId, string $memberId return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e( + $e, + [ + 'emulated' => $emulated, + 'circleId' => $circleId, + 'memberId' => $memberId, + 'level' => $level + ] + ); throw new OcsException($e->getMessage(), $e->getCode()); } } @@ -247,6 +273,7 @@ public function circles(string $emulated): DataResponse { return new DataResponse($this->serializeArray($this->circleService->getCircles())); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -265,6 +292,7 @@ public function circleDetails(string $emulated, string $circleId): DataResponse return new DataResponse($this->serialize($this->circleService->getCircle($circleId))); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId]); throw new OcsException($e->getMessage(), $e->getCode()); } } @@ -284,6 +312,7 @@ public function circleJoin(string $emulated, string $circleId): DataResponse { return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -303,6 +332,7 @@ public function circleLeave(string $emulated, string $circleId): DataResponse { return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -328,6 +358,7 @@ public function memberConfirm(string $emulated, string $circleId, string $member return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId, 'memberId' => $memberId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -350,6 +381,7 @@ public function memberRemove(string $emulated, string $circleId, string $memberI return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId, 'memberId' => $memberId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -368,6 +400,7 @@ public function members(string $emulated, string $circleId): DataResponse { return new DataResponse($this->serializeArray($this->memberService->getMembers($circleId))); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -389,6 +422,7 @@ public function editName(string $emulated, string $circleId, string $value): Dat return new DataResponse($this->serializeArray($outcome)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId, 'value' => $value]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -410,6 +444,7 @@ public function editDescription(string $emulated, string $circleId, string $valu return new DataResponse($this->serializeArray($outcome)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId, 'value' => $value]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -431,6 +466,7 @@ public function editSettings(string $emulated, string $circleId, array $value): return new DataResponse($this->serializeArray($outcome)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId, 'value' => $value]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -452,6 +488,7 @@ public function editConfig(string $emulated, string $circleId, int $value): Data return new DataResponse($this->serializeArray($outcome)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId, 'value' => $value]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -472,6 +509,7 @@ public function link(string $emulated, string $circleId, string $singleId): Data return new DataResponse($this->serialize($membership)); } catch (Exception $e) { + $this->e($e, ['emulated' => $emulated, 'circleId' => $circleId, 'singleId' => $singleId]); throw new OCSException($e->getMessage(), $e->getCode()); } } diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php index 2d70df904..987b6bdb2 100644 --- a/lib/Controller/LocalController.php +++ b/lib/Controller/LocalController.php @@ -143,6 +143,7 @@ public function create(string $name, bool $personal = false, bool $local = false return new DataResponse($this->serializeArray($circle)); } catch (Exception $e) { + $this->e($e, ['name' => $name, 'members' => $personal, 'local' => $local]); throw new OcsException($e->getMessage(), $e->getCode()); } } @@ -163,6 +164,7 @@ public function destroy(string $circleId): DataResponse { return new DataResponse($this->serializeArray($circle)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId]); throw new OcsException($e->getMessage(), $e->getCode()); } } @@ -182,6 +184,7 @@ public function search(string $term): DataResponse { return new DataResponse($this->serializeArray($this->searchService->search($term))); } catch (Exception $e) { + $this->e($e, ['term' => $term]); throw new OcsException($e->getMessage(), $e->getCode()); } } @@ -201,6 +204,7 @@ public function circleDetails(string $circleId): DataResponse { return new DataResponse($this->serialize($this->circleService->getCircle($circleId))); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId]); throw new OcsException($e->getMessage(), $e->getCode()); } } @@ -235,6 +239,7 @@ public function memberAdd(string $circleId, string $userId, int $type): DataResp return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'userId' => $userId, 'type' => $type]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -266,6 +271,7 @@ public function membersAdd(string $circleId, array $members): DataResponse { return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'members' => $members]); throw new OCSException($e->getMessage(), $e->getCode()); } @@ -283,10 +289,12 @@ public function membersAdd(string $circleId, array $members): DataResponse { public function circleJoin(string $circleId): DataResponse { try { $this->setCurrentFederatedUser(); + \OC::$server->getLogger()->log(3, '--- ' . json_encode($circleId)); $result = $this->circleService->circleJoin($circleId); return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -307,6 +315,7 @@ public function circleLeave(string $circleId): DataResponse { return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -336,6 +345,7 @@ public function memberLevel(string $circleId, string $memberId, $level): DataRes return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'memberId' => $memberId, 'level' => $level]); throw new OcsException($e->getMessage(), $e->getCode()); } } @@ -362,6 +372,7 @@ public function memberConfirm(string $circleId, string $memberId): DataResponse return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'memberId' => $memberId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -385,6 +396,7 @@ public function memberRemove(string $circleId, string $memberId): DataResponse { return new DataResponse($this->serializeArray($result)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'memberId' => $memberId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -402,6 +414,7 @@ public function circles(): DataResponse { return new DataResponse($this->serializeArray($this->circleService->getCircles())); } catch (Exception $e) { + $this->e($e); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -421,6 +434,7 @@ public function members(string $circleId): DataResponse { return new DataResponse($this->serializeArray($this->memberService->getMembers($circleId))); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -443,6 +457,7 @@ public function editName(string $circleId, string $value): DataResponse { return new DataResponse($this->serializeArray($outcome)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'value' => $value]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -465,6 +480,7 @@ public function editDescription(string $circleId, string $value): DataResponse { return new DataResponse($this->serializeArray($outcome)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'value' => $value]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -487,6 +503,7 @@ public function editSettings(string $circleId, array $value): DataResponse { return new DataResponse($this->serializeArray($outcome)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'value' => $value]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -509,6 +526,7 @@ public function editConfig(string $circleId, int $value): DataResponse { return new DataResponse($this->serializeArray($outcome)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'value' => $value]); throw new OCSException($e->getMessage(), $e->getCode()); } } @@ -530,6 +548,7 @@ public function link(string $circleId, string $singleId): DataResponse { return new DataResponse($this->serialize($membership)); } catch (Exception $e) { + $this->e($e, ['circleId' => $circleId, 'singleId' => $singleId]); throw new OCSException($e->getMessage(), $e->getCode()); } }