Skip to content

Commit

Permalink
Merge pull request #161 from gesistsa/fix-#160
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics authored Nov 6, 2024
2 parents e051f13 + 2f3deee commit abda4de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/post.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ upload_media_to_mastodon <- function(media, alt_text, token) {
body = params,
httr::add_headers(Authorization = paste0("Bearer ", token$bearer))
)
if (httr::status_code(r) != 200) {
stop(paste0("Error while uploading: ", media, ". Status Code:", httr::status_code(r)))
}

httr::content(r)$id
}

Expand Down

0 comments on commit abda4de

Please sign in to comment.