I was on vacation when a senior PhD student wanted me to help with his project. I rejected and my advisor sent me an email to check whether I wanted to co-author this project a few weeks later. I accepted because he is my advisor and It'll be nice to have a paper for graduation since I just got into the PhD program. I worked on this project for about 3 months with full commitment(including weekends) so that the tool built by the senior student was able to run on some platforms.
But the result turned out to be not very good so the senior decided to remove the part I worked on from paper. But I did all the tasks like analysis and it was not my mistake for the result. He told me my contribution for this part was probably equal to or lower than polishing the paper. The reason is that the paper is the final product for submission. I asked him how to count the contribution and he told me by feeling. I'm really frustrated. My advisor told me to come to his office with the senior maybe talk about the project. I know there is nothing I can do. Maybe someone can help me to overcome my mental issues.