@@ -127,7 +127,7 @@ defmodule CodeCorps.GitHub.Sync do
127127
128128 @ spec sync_step ( tuple , atom ) :: tuple
129129 defp sync_step ( { :ok , _ } = result , _step ) , do: result
130- defp sync_step ( { :error , _ = error } , _step ) , do: { :error , error }
130+ defp sync_step ( { :error , _ } , step ) , do: { :error , step }
131131
132132 @ spec mark_repo ( GithubRepo . t , String . t , map ) :: { :ok , GithubRepo . t } | { :error , Changeset . t }
133133 defp mark_repo ( % GithubRepo { } = repo , sync_state , params \\ % { } ) do
@@ -158,7 +158,7 @@ defmodule CodeCorps.GitHub.Sync do
158158 - Creates or updates `Comment` records, and relates them to any related
159159 `GithubComment` and `User` records created previously
160160 """
161- @ spec sync_repo ( GithubRepo . t ) :: { :ok , GithubRepo . t }
161+ @ spec sync_repo ( GithubRepo . t ) :: { :ok , GithubRepo . t } | { :error , Changeset . t }
162162 def sync_repo ( % GithubRepo { } = repo ) do
163163 repo = preload_github_repo ( repo )
164164 with { :ok , repo } <- repo |> mark_repo ( "fetching_pull_requests" ) ,
@@ -185,6 +185,7 @@ defmodule CodeCorps.GitHub.Sync do
185185 do
186186 { :ok , repo }
187187 else
188+ { :error , % Changeset { } = changeset } -> { :error , changeset }
188189 { :error , :fetch_pull_requests } -> repo |> mark_repo ( "errored_fetching_pull_requests" )
189190 { :error , :sync_pull_requests } -> repo |> mark_repo ( "errored_syncing_pull_requests" )
190191 { :error , :fetch_issues } -> repo |> mark_repo ( "errored_fetching_issues" )
0 commit comments