gama-platform / gama

Main repository for developing the 2024+ versions of GAMA
https://gama-platform.org
GNU General Public License v3.0
12 stars 5 forks source link

[GS] Add information to compilation errors sent back from gama-server #172

Closed lesquoyb closed 2 days ago

lesquoyb commented 2 months ago

Is your request related to a problem? Please describe. When trying to run through gama-server models on which you are currently working, it often happens that there are compilation errors. In that case gama-server returns the list of errors to the client so they know why the model cannot run. The problem is that those errors are just the line of text of the actual error objects, lacking the whole context, like in which file and line they appear as well as their "level" of error: real compilation errors are mixed with warnings and info but we don't know which is which. For example here is what I get for trying to compile a small model:

Compilation errors: 
This definition of shape supersedes the one in built-in species agent
This definition of shape supersedes the one in built-in species agent
machine_time is not defined or accessible in this context. Check its name or declare it
machine_time is not defined or accessible in this context. Check its name or declare it
machine_time is not defined or accessible in this context. Check its name or declare it
No operator found for applying '+' to types [float, unknown] (operators available for [types [map, pair], types [float, int], types [matrix, matrix], types [rgb, rgb], types [container, container], types [map, map], types [float, float], types [string, string], types [field, int], types [field, float], types [float, matrix], types [field, matrix], types [date, int], types [date, float], types [date, string], types [geometry, float], types [point, int], types [point, float], types [int, int], types [point, point], types [geometry, geometry], types [geometry, float, int, int, bool], types [int, float], types [geometry, float, int, int], types [int, matrix], types [geometry, float, int], types [geometry, float, bool], types [container, unknown], types [matrix, int], types [matrix, float], types [rgb, int], types [string, unknown]])
machine_time is not defined or accessible in this context. Check its name or declare it
machine_time is not defined or accessible in this context. Check its name or declare it
machine_time is not defined or accessible in this context. Check its name or declare it
No operator found for applying '+' to types [float, unknown] (operators available for [types [map, pair], types [float, int], types [matrix, matrix], types [rgb, rgb], types [container, container], types [map, map], types [float, float], types [string, string], types [field, int], types [field, float], types [float, matrix], types [field, matrix], types [date, int], types [date, float], types [date, string], types [geometry, float], types [point, int], types [point, float], types [int, int], types [point, point], types [geometry, geometry], types [geometry, float, int, int, bool], types [int, float], types [geometry, float, int, int], types [int, matrix], types [geometry, float, int], types [geometry, float, bool], types [container, unknown], types [matrix, int], types [matrix, float], types [rgb, int], types [string, unknown]])
machine_time is not defined or accessible in this context. Check its name or declare it
machine_time is not defined or accessible in this context. Check its name or declare it
machine_time is not defined or accessible in this context. Check its name or declare it
No operator found for applying '+' to types [float, unknown] (operators available for [types [map, pair], types [float, int], types [matrix, matrix], types [rgb, rgb], types [container, container], types [map, map], types [float, float], types [string, string], types [field, int], types [field, float], types [float, matrix], types [field, matrix], types [date, int], types [date, float], types [date, string], types [geometry, float], types [point, int], types [point, float], types [int, int], types [point, point], types [geometry, geometry], types [geometry, float, int, int, bool], types [int, float], types [geometry, float, int, int], types [int, matrix], types [geometry, float, int], types [geometry, float, bool], types [container, unknown], types [matrix, int], types [matrix, float], types [rgb, int], types [string, unknown]])
machine_time is not defined or accessible in this context. Check its name or declare it
No operator found for applying '+' to types [string, unknown] (operators available for [types [map, pair], types [float, int], types [matrix, matrix], types [rgb, rgb], types [container, container], types [map, map], types [float, float], types [string, string], types [field, int], types [field, float], types [float, matrix], types [field, matrix], types [date, int], types [date, float], types [date, string], types [geometry, float], types [point, int], types [point, float], types [int, int], types [point, point], types [geometry, geometry], types [geometry, float, int, int, bool], types [int, float], types [geometry, float, int, int], types [int, matrix], types [geometry, float, int], types [geometry, float, bool], types [container, unknown], types [matrix, int], types [matrix, float], types [rgb, int], types [string, unknown]])
No file specified
No stopping condition have been defined (facet 'until:'). This may result in an endless run of the batch experiment

And so it's not very convenient to quickly fix the problems, and it's impossible to handle it programmatically (the client could print the info in a certain way, the errors in another for example)

Describe the improvement you'd like A more detailed output of the compilation problems, maybe return an object instead of a message in that case ?