Skip to content

false "Errors thrown from here are not handled" #1098

Open
@nh7a

Description

@nh7a

Description

Build failure due to "Errors thrown from here are not handled" occurs depending on the following line of code.

Reproduction

@Test func myTest() throws {
  let db = AppDatabase().mock()
  try db.reader.read { ctx in
    #expect(try MyModel.fetchCount(ctx) == 0)  // ❌ Errors thrown from here are not handled
  }
}
@Test func myTest() throws {
  let db = AppDatabase().mock()
  try db.reader.read { ctx in
    #expect(try MyModel.fetchCount(ctx) == 0)  // ✅
    let count = try MyModel.fetchCount(ctx)
    #expect(count == 0)
  }
}

Expected behavior

It has to build without an error.

Environment

swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0

Darwin nh7a 24.4.0 Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:47 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6030 arm64

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🪲 Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions