Skip to content

Commit

Permalink
fix: support for custom description in custom error
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Jul 9, 2024
1 parent 9899814 commit 45e5243
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/LangGraph/LangGraph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public struct BaseAgentState : AgentState {


}
public enum StateGraphError : Error {
public enum StateGraphError : Error, LocalizedError {
case duplicateNodeError( String )
case duplicateEdgeError( String )
case missingEntryPoint
Expand All @@ -108,7 +108,7 @@ public enum StateGraphError : Error {
case invalidNodeIdentifier( String )
case missingNodeReferencedByEdge( String )

public var localizedDescription: String {
public var errorDescription: String? {
switch(self) {
case .duplicateNodeError(let message):
message
Expand All @@ -135,13 +135,13 @@ public enum StateGraphError : Error {

}

public enum CompiledGraphError : Error {
public enum CompiledGraphError : Error, LocalizedError {
case missingEdge( String )
case missingNode( String )
case missingNodeInEdgeMapping( String )
case executionError( String )

public var localizedDescription: String {
public var errorDescription: String? {
switch(self) {
case .missingEdge(let message):
message
Expand Down

0 comments on commit 45e5243

Please sign in to comment.