Skip to content

fix(Helper): do not expose internal exception#1935

Open
silverkszlo wants to merge 1 commit into
mainfrom
fix/internal-exception-helper
Open

fix(Helper): do not expose internal exception#1935
silverkszlo wants to merge 1 commit into
mainfrom
fix/internal-exception-helper

Conversation

@silverkszlo

@silverkszlo silverkszlo commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Refers to: nextcloud/notes-android#3131 (comment)

Do not expose internal exception in Helper.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: silver <s.szmajduch@posteo.de>

Assisted-by: ClaudeCode:claude-sonnet-5
@silverkszlo silverkszlo requested a review from enjeck as a code owner July 15, 2026 06:37
Comment thread lib/Controller/Helper.php
Comment on lines +126 to +128
public function createErrorResponse(\Throwable $e, int $statusCode, bool $exposeType = true) : JSONResponse {
$response = [
'errorType' => get_class($e)
'errorType' => $exposeType ? get_class($e) : 'Exception'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should never expose the type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants