Method FormatException
- Namespace
- GrindFest.GameMaster.Helpers
- Assembly
- GrindFest.dll
FormatException(Exception, string, object)
Formats an exception into a detailed JSON error response for MCP tools. Includes exception type, message, stack trace, inner exceptions (recursively), and tool context. Also logs the exception to Unity console for debugging.
public static string FormatException(Exception ex, string toolName, object context = null)
Parameters
exExceptionThe exception to format
toolNamestringName of the MCP tool that encountered the error
contextobjectOptional additional context (e.g., parameter values)
Returns
- string
JSON string with detailed error information