Move #error{} definition to rexi.hrl
diff --git a/include/rexi.hrl b/include/rexi.hrl
new file mode 100644
index 0000000..b51c5af
--- /dev/null
+++ b/include/rexi.hrl
@@ -0,0 +1,22 @@
+% Copyright 2010 Cloudant
+%
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-record(error, {
+    timestamp,
+    reason,
+    mfa,
+    nonce,
+    stack
+}).
+
diff --git a/src/rexi.erl b/src/rexi.erl
index f5a5e7e..22097b3 100644
--- a/src/rexi.erl
+++ b/src/rexi.erl
@@ -19,6 +19,8 @@
 -export([async_server_call/2, async_server_call/3]).
 -export([get_errors/0, get_last_error/0, set_error_limit/1]).
 
+-include("rexi.hrl").
+
 -define(SERVER, rexi_server).
 
 start() ->
@@ -30,11 +32,11 @@
 restart() ->
     stop(), start().
 
--spec get_errors() -> {ok, list()}.
+-spec get_errors() -> {ok, [#error{}]}.
 get_errors() ->
     gen_server:call(?SERVER, get_errors).
 
--spec get_last_error() -> {ok, term()} | {error, empty}.
+-spec get_last_error() -> {ok, #error{}} | {error, empty}.
 get_last_error() ->
     gen_server:call(?SERVER, get_last_error).
 
diff --git a/src/rexi_server.erl b/src/rexi_server.erl
index ada9c94..24b729d 100644
--- a/src/rexi_server.erl
+++ b/src/rexi_server.erl
@@ -19,6 +19,7 @@
 
 -export([start_link/0, init_p/2, init_p/3]).
 
+-include("rexi.hrl").
 -include_lib("eunit/include/eunit.hrl").
 
 -record(st, {
@@ -28,14 +29,6 @@
     error_count = 0
 }).
 
--record(error, {
-    timestamp,
-    reason,
-    mfa,
-    nonce,
-    stack
-}).
-
 start_link() ->
     gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).