Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions PythonScript/project/PythonScript2010.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py
<ClCompile Include="..\src\GILManager.cpp" />
<ClCompile Include="..\src\GroupNotFoundException.cpp" />
<ClCompile Include="..\src\HelpController.cpp" />
<ClCompile Include="..\src\InvalidValueProvidedException.cpp" />
<ClCompile Include="..\src\MainThread.cpp" />
<ClCompile Include="..\src\Match.cpp" />
<ClCompile Include="..\src\MatchPython.cpp" />
Expand Down Expand Up @@ -482,6 +483,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py
<ClInclude Include="..\src\GroupNotFoundException.h" />
<ClInclude Include="..\src\HelpController.h" />
<ClInclude Include="..\src\IDAllocator.h" />
<ClInclude Include="..\src\InvalidValueProvidedException.h" />
<ClInclude Include="..\src\MainThread.h" />
<ClInclude Include="..\src\Match.h" />
<ClInclude Include="..\src\MatchPython.h" />
Expand Down
14 changes: 14 additions & 0 deletions PythonScript/src/InvalidValueProvidedException.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "stdafx.h"

#include "InvalidValueProvidedException.h"


namespace NppPythonScript
{

void translateInvalidValueProvidedException(const InvalidValueProvidedException &e)
{
PyErr_SetString(PyExc_RuntimeError, e.what());
}

}
31 changes: 31 additions & 0 deletions PythonScript/src/InvalidValueProvidedException.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#ifndef INVALIDVALUEPROVIDEDEXCEPTION_20180413_H
#define INVALIDVALUEPROVIDEDEXCEPTION_20180413_H

namespace NppPythonScript
{

class InvalidValueProvidedException
{
public:
explicit InvalidValueProvidedException(const char *desc)
: m_desc(desc)
{};

const char *what() const
{
return m_desc.c_str();
}

private:
InvalidValueProvidedException(); // default constructor disabled

std::string m_desc;
};



void translateInvalidValueProvidedException(const InvalidValueProvidedException &e);

}

#endif // INVALIDVALUEPROVIDEDEXCEPTION_20140214_H
Loading