Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign getLayer template error message; catch and log error in addLayer #1383

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

dbauszus-glx
Copy link
Member

An error object can not be sent with the layer json.

The Error.message can be assigned to the layer json instead.

The addLayer() method can check for an err message and log this.

image

@dbauszus-glx dbauszus-glx self-assigned this Jul 17, 2024
@dbauszus-glx dbauszus-glx added the Bug A genuine bug. There must be some form of error exception to work with. label Jul 17, 2024
@dbauszus-glx dbauszus-glx linked an issue Jul 17, 2024 that may be closed by this pull request
@simon-leech simon-leech changed the title Assigne getLayer template error message; catch and log error in addLa… Assigne getLayer template error message; catch and log error in addLayer Jul 17, 2024
@simon-leech simon-leech changed the title Assigne getLayer template error message; catch and log error in addLayer Assign getLayer template error message; catch and log error in addLayer Jul 17, 2024
@simon-leech
Copy link
Contributor

simon-leech commented Jul 17, 2024

I pushed a commit to change layer.err into an array.
I did this as we also need to check on layer.templates inside the getLayer method.

Example configuration for testing

"templates":{ 
   "test_1": {
     "template": "path/path.json",
    },
    "test_2_template": {
    "template": "path/path.json",
    },
    ,
    "test_3_template": {
    "template": "path/path.json",
    }
}, 
"layers": {
  "test_1": {
  "templates": ["test_2_template", "test_3_template"] 
}
}

The example above, before my commit you would only see an error for the overall layer file path being wrong.
With this commit we now also check on the file path of anything in the layer.templates array, and error those too.

@simon-leech simon-leech reopened this Jul 17, 2024
@RobAndrewHurst RobAndrewHurst merged commit a42ce74 into GEOLYTIX:main Jul 18, 2024
6 checks passed
@dbauszus-glx dbauszus-glx deleted the getlayer-err branch September 9, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A genuine bug. There must be some form of error exception to work with.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Template Errors
3 participants