Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

Single-file components (.cfm/.bxm) are parsed into separate generated class and template files. When exceptions occur, stack traces reference these temp files, making it difficult to locate errors in the original source.

Changes

  • Source tracking in SingleFileComponentBuilder: Parse and track @startWire line number during file processing
  • Metadata injection in generated components: EmptySingleFileComponent.cfc/.bx now includes _singleFileSourcePath and _singleFileLineOffset variables
  • Error enhancement in Component.cfc:
    • _isSingleFileComponent(), _getSingleFileSourcePath(), _getSingleFileLineOffset() - accessor methods
    • _buildEnhancedErrorMessage() - constructs debug info with source file path and estimated line numbers
    • Exception wrapping in _applyCalls(), _render(), and _withParams()

Example Output

When an error occurs in a single-file component:

Variable [UNDEFINED_VAR] is undefined

=== CBWIRE Single-File Component Debug Info ===
Original source file: /app/wires/MyComponent.cfm
Wire code starts at line: 8 in the original file
Estimated source line: ~15
================================================

Tests

Added unit tests for SingleFileComponentBuilder.parseContents() line tracking and Component single-file detection/error enhancement methods.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.ortussolutions.com
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Improve error reporting when exceptions occur on single file components/wires.</issue_title>
<issue_description>When single file components are used (which are either a single .bxm or .cfm file), the models/SingleFileComponentBuilder.cfc component is responsible for parsing the file and creating separate class and template files, which are then used to process the wire as usual. If problem is that if an exception occurs within the wire or processing of the template, the stacktrace is not very helpful to developers because it doesn't accurately tell what line the error was thrown on and the stack trace itself is confusing. We are limited in that none of the CFML or BoxLang engines allow us to overwrite the stack trace.

We need to come up with ideas for how to improve the developer experience with this.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@github-actions
Copy link

lucee@5 Test Results

295 tests  ±0   273 ✅ ±0   5s ⏱️ ±0s
  8 suites ±0    22 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 853823d. ± Comparison against base commit 0f00578.

@github-actions
Copy link

boxlang-cfml@1 Test Results

295 tests  ±0   277 ✅ ±0   10s ⏱️ ±0s
  8 suites ±0    18 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 853823d. ± Comparison against base commit 0f00578.

@github-actions
Copy link

lucee@6 Test Results

295 tests  ±0   273 ✅ ±0   4s ⏱️ ±0s
  8 suites ±0    22 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 853823d. ± Comparison against base commit 0f00578.

@github-actions
Copy link

adobe@2023 Test Results

295 tests  ±0   273 ✅ ±0   6s ⏱️ -1s
  8 suites ±0    22 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 853823d. ± Comparison against base commit 0f00578.

@github-actions
Copy link

adobe@2025 Test Results

295 tests  ±0   273 ✅ ±0   6s ⏱️ ±0s
  8 suites ±0    22 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 853823d. ± Comparison against base commit 0f00578.

Copilot AI changed the title [WIP] Improve error reporting for single file components Improve error reporting for single-file component exceptions Nov 25, 2025
Copilot AI requested a review from grantcopley November 25, 2025 06:37
Copilot finished work on behalf of grantcopley November 25, 2025 06:37
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