Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

add errorInfo setter to PDOException. #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 34 additions & 31 deletions Source/Extensions/PDO/PDOException.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PHP.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PHP.Core;
using PHP.Library.SPL;
using System.ComponentModel;
using PHP.Core.Reflection;
using System.Runtime.Serialization;

namespace PHP.Library.Data
{
[ImplementsType]
public class PDOException : RuntimeException
{
using System.Runtime.Serialization;
namespace PHP.Library.Data
{
[ImplementsType]
public class PDOException : RuntimeException
{
#region Implementation Details

/// <summary>
Expand Down Expand Up @@ -47,22 +47,25 @@ protected PDOException(SerializationInfo info, StreamingContext context)
}

#endif
#endregion

private PhpArray m_errorInfo;

private PDOException(ScriptContext context, PhpArray errorInfo)
: base(context, true)
{
this.m_errorInfo = errorInfo;
}

[PhpVisible]
public PhpArray errorInfo { get { return this.m_errorInfo; } }

public static void Throw(ScriptContext context, string message, PhpArray errorInfo, object code, object previous)
{
PHP.Library.SPL.Exception.ThrowSplException(ctx => new PDOException(ctx, errorInfo), context, message, code, previous);
}
}
}
#endregion

private PhpArray m_errorInfo;

private PDOException(ScriptContext context, PhpArray errorInfo)
: base(context, true)
{
this.m_errorInfo = errorInfo;
}

[PhpVisible]
public PhpArray errorInfo {
get { return this.m_errorInfo; }
set { this.m_errorInfo = value; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the diff mess caused by GitHub online editor, this is the only changed line actually.

}

public static void Throw(ScriptContext context, string message, PhpArray errorInfo, object code, object previous)
{
PHP.Library.SPL.Exception.ThrowSplException(ctx => new PDOException(ctx, errorInfo), context, message, code, previous);
}
}
}