My red eye tree frog just passed away about a week ago and I am wondering what went wrong. I would like to get another one in the future but am a little leery about it.

description of ailments :
- he was weak / didn’t feel like eating/ and he turned a little bluish, brownish when he died (as if he were bruised)