API Function 'resource_info' Logs an Error for a Missing Resource

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Post Reply
Message
Author
Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

API Function 'resource_info' Logs an Error for a Missing Resource

#1 Post by Tetrachromat »

The API function 'resource_info' logs an error message in the AM log file if the resource is not found in the 'resources' folder. But this is not an ERROR.

As the WIKI states explicitely, a use case of the function is to 'check if a resource exists' .

If the resource does not exist, the function returns 'nil', and one can handle the case in code.

I suggest to remove the logging in this case.

Paul

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: API Function 'resource_info' Logs an Error for a Missing Resource

#2 Post by Corjan »

Hi,


Good point, will fix this in the next release of AM.


Thanks for pointing this out,

Corjan

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: API Function 'resource_info' Logs an Error for a Missing Resource

#3 Post by Corjan »

Hi,


Fixed, and will be part of upcoming AM 4.1.4 build.


Corjan

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: API Function 'resource_info' Logs an Error for a Missing Resource

#4 Post by Tetrachromat »

Well done. Appreciate that.

Paul

Post Reply