Notepad++ plugin exception - plugins

I am developing a notepad++ plugin in c++ by using Visual Studio 2013. I put my plugin's dll to the notepad++ plugin directory. When i try to run my plugin in notepad+ menu, it gives "Unknown exception" with window title: PluginsManager::runPluginCommand Exception. How can solve it? Any help is appreciated.
Thanks.

I have not (yet) found a way to replace or to add more details to the "Unknown exception" message, but I do have a workaround.
For exceptions raised at plugin startup I surrounded the PluginBase.SetCommand(...); call with a try...catch...:
try {
PluginBase.SetCommand(...);
}
catch ( Exception ex )
{
Win32.SendMessage(PluginBase.GetCurrentScintilla(),
SciMsg.SCI_INSERTTEXT, -1,
"Exception at startup in <name of my plugin>: " + ex.ToString());
}
I do not recommend this for the final version of a plugin, but it can help with getting the plugin working. My reasons for not recommending it are:
It catches every exception.
It writes the exception message into the
current buffer. It would be easy to not notice the exception message,
to assume that the plugin worked, and hence to corrupt the contents
of the file being edited.
The same technique can be used with the methods called when the plugin is executed.

Related

Groovy:General error during semantic analysis: java.lang.NoSuchMethodError:

Imported the gradle project from the "complete" folder and received the following error:
Groovy:General error during semantic analysis:
java.lang.NoSuchMethodError: 'org.codehaus.groovy.ast.expr.Expression org.codehaus.groovy.ast.tools.GeneralUtils.propX(org.codehaus.groovy.ast.expr.Expression, java.lang.String)'
I am using the latest version of Eclipse, 2020-12, with groovy tools installed.
From grails guide
https://guides.grails.org/gorm-without-grails/guide/index.html
Downloaded code sample from github
https://github.com/grails-guides/gorm-without-grails.git
It seems likely to be a version mismatch, but I cannot determine how to correct this problem.
I have tried to delete the offending file, src/main/groovy/demo/domain/Manufacturer.groovy, and the error appears on the file in this package on line 1.
The error does not appear in any other package. I have done the usual internet searches for resolutions that apply, but have thus far been unable to find a suitable solution. I am hopeful for a suggestion?
I think this error comes from an AST transform that references the older signature of GeneralUtils#propX. This method used to return Expression and was changed to return PropertyExpression.
The bridge method for binary compatibility was missing in groovy-eclipse. https://github.com/groovy/groovy-eclipse/commit/f6f448675d95f858b4ec65b6fc8e55f27ccaaa94

The ECLIPSE RCP project could not be exported successfully

I met an error when I exported the Eclipse Product using the export wizard on the overview tab of the .product file ,
the error message is as below .
but it worked just fine when I ran it from inside of Eclipse as an Eclipse Application.
can anybody provide some idea about this .
C:\workSpace\0709\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86_64.xml:90: The following error occurred while executing this line:
C:\workSpace\0709\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86_64.xml:1140: The following error occurred while executing this line:
C:\tool\eclipse-standard-kepler-SR2-win32-x86_64\eclipse\plugins\org.eclipse.pde.build_3.8.100.v20130514-1028\scripts\genericTargets.xml:243: A problem occured while invoking the director.
Thanks & Regards,
Jeff
The originating problem is somewhere else.. To find it out add following line to your genericTargets.xml under node <target name="runDirector"> -> <record name="path_to_log_output_file" loglevel="verbose"> . Then you will probably see actual problem.

How to find location of error from stacktrace alone

If I run a java file from my IDE and an exception is thrown, a hyperlink is printed that I can use to view the line of code that threw the Exception.
However, if I run from terminal all I will get is something like this:
at java.util.TreeMap.put(TreeMap.java:531)
with obviously no hyperlink. How do I use the 531 to navigate to the line of code that is responsible for the error?
You can copy/paste your stacktrace to the eclipse console. Your stacktrace will magically become clickable and will open the file in which the error occured, provided eclipse has it in its class path.

Why this exception not thrown under Junit in Eclipse?

all
I am scratching my head over a problem I ran into with junit test under Eclipse in particular:
Basically, I have a junit 4 test class, the initialization method annotated with
#BeforeClass tries to set up the DB connection, which essentially calls:
try {
return DriverManager.getConnection (DB_CONNECTION_URL,
DB_USERNAME,
DB_PASSWORD);
} catch (SQLException ex) {
throw new MyPersistenceException("Error: unable to connect to database");
}
Now, if I ran the code in a standalone main(), the exception is thrown as expected when database is offline. However, as soon as I move it into junit #BeforeClass, the exception seems lost in blackhole - you can still trace to the exception (remember, the database is offline), but nothing prints in the console.
I am baffled by the behavior, and seems have something to do with Eclipse and Junit in particular (the same unit test run fine under NetBean) - so it is a kind shot in the dark to see anyone experience any similar problem or got any idea ...
Thanks
Oliver
I think this might be a bug in the Eclipse plugin. I've traced the code in JUnit 4 source. The class RunBefores will throw an exception as you mention. However, the exception will go into the EachTestNotifier's failure list via the addFailure. If the plugin is ignoring something, it could explain why the issue is missed.

Selenium RC - User Extension

Planning to calculate page response time using "Timer Extension" using http://wiki.openqa.org/display/SEL/Timer+Extension.
I have copied the code in "User-Extension.js" and updated the path in Selenium RC.
When I execute following code using eclipse, I am getting following error message "method timerStart(string) is undefined".
System.out.println("Test Strated");
timerStart("LoginPage");
selenium.open(BASE_URL_1);
selenium.waitForPageToLoad(MAX_WAIT_TIME_IN_MS);
timerStop("LoginPage");
How to make eclipse recognize this new method ?
-Bharath
The new method is added to Selenium's prototype. So I think you would have to do:
selenium.timerStart("LoginPage");