LaravelFCM\Response\TopicResponse::error PHP Method

error() public method

return error message you should test if it's necessary to resent it
public error ( ) : string
return string error
    public function error()
    {
        return $this->error;
    }

Usage Example

    /**
     * @test
     */
    public function it_construct_a_topic_response_with_error_and_it_should_retry()
    {
        $topic = new \LaravelFCM\Message\Topics();
        $topic->topic('topicName');
        $response = new Response(200, [], '{ 
				"error": "TopicsMessageRateExceeded"
		}');
        $topicResponse = new TopicResponse($response, $topic);
        $this->assertFalse($topicResponse->isSuccess());
        $this->assertTrue($topicResponse->shouldRetry());
        $this->assertEquals("TopicsMessageRateExceeded", $topicResponse->error());
    }