The purpose of SQL query is to select some data from the database and send it to some client. You SP does nothing!
You declare some local variable, set it value and exit.
You have to add some select to your SP, like:
SELECT @p_error_msg
However the exact solution depends on your need.
One more thing! Lines like these, make suspicious about your knowledge and understanding of SQL. These lines do NOTHING!!!
if @p_error_code<>'0'
BEGIN
SET @p_error_msg =@p_error_msg
END