Opened 6 years ago

# try catch in the templates

Reported by: Owned by: sixto antonio minor DownscalingPortal daniel, max, antonio, gutierjm, vegasm

The current structure of the try catch order in the templates is using two different approaches losing some of the variables used and, thus, not working as it was expected.
The templates should be modified according to one of these two approaches:

• use the fields of the ex structure, defined to recover the error message:
 try
catch ex
disp(ex.message)
end

• use lasterr without the ex structure
 try
catch
disp(lasterr)
end


In the current version both approaches are mixed and the value of the lasterr function is lost leading to an empty empty message.

We need to know where are the templates in order to fix the bug.

### comment:1 follow-up: ↓ 4 Changed 6 years ago by daniel

The templates are in the java/main/resources/templates folder of the project.

### comment:2 Changed 6 years ago by antonio

• Description modified (diff)

### comment:3 in reply to: ↑ description Changed 6 years ago by antonio

The disp(ex.message) doesn't report the stack-trace which is useful to have in the error log.

This will do it.

 try
...
catch MEx
disp(getReport(MEx))
end


which will output

>> disp(getReport(MEx))
Attempt to reference field of non-structure array.

Error in ==> readXMLDownscalingJob at 8
job.predictor = char(root.getElementsByTagName('predictor').item(0).getTextContent);

Error in ==> downscaling_41812_test at 59



Antonio

Last edited 6 years ago by antonio (previous) (diff)

### comment:4 in reply to: ↑ 1 Changed 6 years ago by antonio

The templates are in the java/main/resources/templates folder of the project.

In the current version instead of having the templates inside the jar, they are in his own directory:

[antonio@oceano templates]$svn info . Path: . URL: http://dev.predictia.es/svn/dp/branches/is-enes2/scripts/matlab/templates Repository Root: http://dev.predictia.es/svn/dp Repository UUID: 0445610c-9e69-4045-a778-2292f9eb93a3 Revision: 670 Node Kind: directory Schedule: normal Last Changed Author: cofinoa Last Changed Rev: 660 Last Changed Date: 2016-04-19 16:07:53 +0200 (Tue, 19 Apr 2016)  ### comment:5 follow-up: ↓ 6 Changed 6 years ago by antonio Manu, The current WC copy has a non committed changes: [antonio@oceano templates]$ svn st
?       climate2.m
?       featureselection.m
M       climate.m


and the SVN URL:

http://dev.predictia.es/svn/dp/branches/is-enes2/scripts/matlab/templates


points to a pre-merged (¿?) status.

I will commit the changes from my local WC, but I need before the SVN URL to commit the changes.

Antonio

### comment:6 in reply to: ↑ 5 Changed 6 years ago by vegasm

• Owner changed from vegasm to antonio
• Status changed from new to assigned

Manu,

The current WC copy has a non committed changes:

[antonio@oceano templates]\$ svn st
?       climate2.m
?       featureselection.m
M       climate.m


and the SVN URL:

http://dev.predictia.es/svn/dp/branches/is-enes2/scripts/matlab/templates


points to a pre-merged (¿?) status.

I will commit the changes from my local WC, but I need before the SVN URL to commit the changes.

Antonio

Fixed. It was necessary to relocate the SVN URL and solve a conflict in the climate.m file.

### comment:7 follow-up: ↓ 9 Changed 6 years ago by antonio

In the templates directory there are several files

climate2.m
climate.m
featureselection.m
hindcast.m
predictor.m
seasonal.m
validation.m


all of them are to be fixed?

what is the featuresection.m?

and the climate2.m?

A.

Last edited 6 years ago by antonio (previous) (diff)

### comment:9 in reply to: ↑ 7 Changed 6 years ago by vegasm

In the templates directory there are several files

climate2.m
climate.m
featureselection.m
hindcast.m
predictor.m
seasonal.m
validation.m


all of them are to be fixed?

what is the featuresection.m?

and the climate2.m?

A.

climate.m is using the REST service.

featureselection.m, hindcast.m, predictor.m, seasonal.m and validation.m need to be adapted to use the REST service.

climate2.m is the old climate.m. We created it when we started to adapt them. I commited it in order to have a copy of the old one but it can be removed now from the WC.

Note: See TracTickets for help on using tickets.