Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 11, 2025

Summary

  • Renamed ThrowExtensions.h to ExceptionFactory.h in the C++ implementation
  • Updated all references including include statements and Visual Studio project files
  • The C++ functions return exception objects rather than throwing them, making "ExceptionFactory" a more accurate name

Background

The issue was that the C++ ThrowExtensions.h file contains functions that return exception objects (like std::logic_error) rather than throwing them, making the name misleading:

// These are factory functions that return exceptions, not throw them
auto NotSupportedException() { return std::logic_error("Not supported exception."); }
auto NotImplementedException() { return std::logic_error("Not implemented exception."); }

These are used with throw by calling code:

throw Platform::Exceptions::NotSupportedException();

The C# version correctly uses the name ThrowExtensions because those methods actually do throw exceptions.

Changes Made

  • Renamed cpp/Platform.Exceptions/ThrowExtensions.hcpp/Platform.Exceptions/ExceptionFactory.h
  • Updated include in Platform.Exceptions.h
  • Updated Visual Studio project files (.vcxproj and .vcxproj.filters)

Test Plan

  • Verify all references updated correctly
  • Ensure C# ThrowExtensions remain unchanged (they correctly throw exceptions)
  • CI will verify compilation works correctly

Fixes #76

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #76
@konard konard self-assigned this Sep 11, 2025
konard and others added 2 commits September 11, 2025 10:03
The functions in the C++ version return exception objects rather than throwing them,
making "ThrowExtensions" a misleading name. "ExceptionFactory" better reflects that
these are factory functions that create exception objects for later use.

Updated all references:
- Platform.Exceptions.h include statement
- Visual Studio project files (.vcxproj and .vcxproj.filters)

Fixes #76

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Should we rename ThrowExtensions to something else because they return errors, not throw Rename C++ ThrowExtensions to ExceptionFactory to reflect actual behavior Sep 11, 2025
@konard konard marked this pull request as ready for review September 11, 2025 07:07
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.

Should we rename ThrowExtensions to something else because they return errors, not throw

2 participants