Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions lib/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand All @@ -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());
}
}
Expand Down Expand Up @@ -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());
}
}
Expand Down Expand Up @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand Down
19 changes: 19 additions & 0 deletions lib/Controller/LocalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand Down Expand Up @@ -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());
}
}
Expand Down Expand Up @@ -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());
}

Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand Down Expand Up @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand Down