private function post($post) { try { print "\n---------\n"; print $post->body; print "\n---------\n"; return ShackApi::post($this->username, $this->password, $post->body, $this->parentId); } catch (Exception $e) { print "--> exception while posting {$e}\n"; while (true) { print "--> exception caused sleep 120 secs\n"; sleep(120); return ShackApi::post($this->username, $this->password, $post->body, $this->parentId); } } }