Get the exit code from the execution of a windows_package resource

Hello All,

I am using the windows_package resource in my recipe to install various editions and versions of Visual Studio. The Visual Studio installation exits with different exit codes. Is there an easy way to capture this exit code and take actions? For example: if there is a non zero exit code , i might want to print a certain message to the end user. My investigation so far says that, i can accomplish this using handlers. I wanted to know if there exists a better way to capture the exit codes from a windows_package resource. Kindly let me know. I am using chef solo btw.