File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 114114 source-name)
115115 (cond
116116 [(unbox error-box)
117- (log-resyntax-error
117+ (log-resyntax-warning
118118 "analyzer ~a failed with error while analyzing ~a: ~a "
119119 (object-name analyzer)
120120 source-name
413413 (check-true (syntax-property-bundle? props))
414414 (define root-props (syntax-property-bundle-get-immediate-properties props empty-syntax-path))
415415 ;; The fast-prop should be present since the analyzer completed successfully
416- (check-equal? (hash-ref root-props 'fast-prop #false ) #true )))
416+ (check-equal? (hash-ref root-props 'fast-prop #false ) #true ))
417+
418+ (test-case "failing analyzer is skipped and warning is logged "
419+ ;; Create a test analyzer that raises an error
420+ (define test-source (string-source "#lang racket/base (define x 1) " ))
421+
422+ (define failing-analyzer
423+ (make-expansion-analyzer
424+ #:name 'failing-analyzer
425+ (λ (expanded)
426+ ;; This will raise an error
427+ (error "intentional test error " ))))
428+
429+ ;; Run analysis with the failing analyzer - should skip it and not crash
430+ (define analysis (source-analyze test-source #:analyzers (list failing-analyzer)))
431+
432+ ;; Check that the analysis completed (even though the analyzer failed)
433+ (check-true (source-code-analysis? analysis))))
You can’t perform that action at this time.
0 commit comments