File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ defmodule Briefly do
24
24
"""
25
25
@ spec create ( create_opts ) ::
26
26
{ :ok , binary }
27
+ | { :no_space , binary }
27
28
| { :too_many_attempts , binary , pos_integer }
28
29
| { :no_tmp , [ binary ] }
29
30
def create ( opts \\ [ ] ) do
Original file line number Diff line number Diff line change @@ -173,8 +173,14 @@ defmodule Briefly.Entry do
173
173
:ets . insert ( @ path_table , { self ( ) , path } )
174
174
{ :ok , path }
175
175
176
+ { :error , :enospc } ->
177
+ { :no_space , path }
178
+
176
179
{ :error , reason } when reason in [ :eexist , :eacces ] ->
177
180
open ( options , tmp , attempts + 1 )
181
+
182
+ error ->
183
+ error
178
184
end
179
185
end
180
186
@@ -186,8 +192,14 @@ defmodule Briefly.Entry do
186
192
:ets . insert ( @ path_table , { self ( ) , path } )
187
193
{ :ok , path }
188
194
195
+ { :error , :enospc } ->
196
+ { :no_space , path }
197
+
189
198
{ :error , reason } when reason in [ :eexist , :eacces ] ->
190
199
open ( options , tmp , attempts + 1 )
200
+
201
+ error ->
202
+ error
191
203
end
192
204
end
193
205
You can’t perform that action at this time.
0 commit comments