Skip to content

Fix CS1985: move await calls out of catch block - #76

Open
netanelcyber wants to merge 11 commits into
mainfrom
claude/project-thread-igwvvz
Open

netanelcyber wants to merge 11 commits into
mainfrom
claude/project-thread-igwvvz

Conversation

@netanelcyber

Copy link
Copy Markdown
Owner
\n_Requested by **NETANEL** · [project thread](https://claude.ai/code/project/chan_01GaZgA4PytGzUYJgL2oxYiS?thread=cmsg_01GaZgA4PytGzUYJgL2oxYiSKN1k5XUJ7EzdqXJgZQa7Xf)_\n\n**Before:** The `bACTIVE_Click` handler in `AdPentest.aspx` used `await` inside a `catch` block (lines 406 and 411), which is not allowed in C# 5 (.NET 4.5.2), causing compiler error CS1985.\n\n**After:** The exception is captured in a variable (`caughtEx`), and the async database cleanup runs after the `try/catch/finally` block. Same behavior, no `await` inside `catch`.\n\n**How:** Declared `Exception caughtEx = null` before the try block, stored the caught exception, and moved the async error-handling logic to an `if (caughtEx != null)` block after `finally`.\n\n---\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nhttps://claude.ai/code/session_01JjqUXqUEvfhZuHKGvTzPo8

Generated by Claude Code

tenten48tenten and others added 11 commits September 16, 2026 17:18
feat: Jinja2-based interactive HTML pentest report generator (Closes #22)
Brings over AdPentest.aspx from the earlier session branch
(claude/eager-cray-4gl5be) with correct Page directive and assembly
references: EntityFramework, System.Data.SQLite, System.Data.SQLite.EF6,
Newtonsoft.Json, and System.ComponentModel.DataAnnotations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQhrDWE9kCvwRXjg9dNLGC
- Include target in CVE dedup key so multi-host findings are not collapsed
- Validate CVE match entries are JObject before indexing
- Allow PopulateReport on truncated output (JSON may still be valid)
- Observe cancellation token to stop scan on app pool recycle
- Add fallbacks for target/mode fields to accept older report formats
- Fix confidence caption from "all low" to "low- to medium-confidence"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQhrDWE9kCvwRXjg9dNLGC
- Validate Host header (localhost/127.0.0.1/[::1]) to block DNS-rebinding
  attacks against the IsLocal-only page
- Guard exit-code status assignment with !cancelled so "cancelled" status
  is not overwritten by "completed"/"failed"/"output-truncated"
- Check activeSearch is JObject before indexing into it

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQhrDWE9kCvwRXjg9dNLGC
- DrainAsync now reads up to 4 MiB (MaxParseChars) for report parsing
  while still capping the DB-stored display at 512 KiB, so large JSON
  reports are parsed correctly even when display output is truncated
- run_id is now optional in PopulateReport so sample/imported JSON
  without a run_id can be imported successfully
- When QueueBackgroundWorkItem fails, update the DB row from "queued"
  to "error" so it does not mislead operators

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQhrDWE9kCvwRXjg9dNLGC
The row variable was declared inside try, making row.Id unreachable
in the catch block. Moved rowId declaration before try and added a
guard (rowId > 0) so the error-status update only runs after a
successful DB insert.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQhrDWE9kCvwRXjg9dNLGC
- output-truncated status only replaces "completed", preserving
  "failed" and "timeout" statuses when output is also truncated
- Target field in PopulateReport is now optional; falls back to
  row.RequestedTarget so CLI error reports without a target field
  are accepted
- Port list caption in Hebrew and English now matches the actual
  ports scanned by active_service_search in core.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQhrDWE9kCvwRXjg9dNLGC
…mode

- stream-timeout no longer overwrites cancelled/timeout status
- PopulateReport runs whenever stdout completed, even during
  stream-timeout (stderr-only timeout no longer blocks parsing)
- Mode falls back to row.Mode for targetless error reports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQhrDWE9kCvwRXjg9dNLGC
Add ASP.NET Web Forms dashboard with verified page directives
C# 5 (.NET 4.5.2) does not allow await inside catch clauses.
Refactored bACTIVE_Click to capture the exception in a variable,
then handle the async DB cleanup after the try/catch/finally block.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JjqUXqUEvfhZuHKGvTzPo8
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@netanelcyber netanelcyber self-assigned this Sep 28, 2026
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.

3 participants