Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 18 additions & 29 deletions src/main/kotlin/io/ionic/libs/ioncameralib/model/IONCAMRError.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,24 @@ package io.ionic.libs.ioncameralib.model

enum class IONCAMRError(val code: Int, val description: String) {
CAMERA_PERMISSION_DENIED_ERROR(3, "Couldn't access camera. Check your camera permissions and try again."),
NO_IMAGE_SELECTED_ERROR(5, "No image selected."),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we re-use 5 for something then? Don't see it being used elsewhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we should. I was still going to do that but wanted to go through the list of errors in Confluence first and only then start changing error codes

Copy link
Copy Markdown
Contributor Author

@alexgerardojacinto alexgerardojacinto Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it now, it's being used for the GALLERY_PERMISSION_DENIED_ERROR now

GALLERY_PERMISSION_DENIED_ERROR(6, "Couldn't access your photo gallery because access wasn't provided."),
NO_PICTURE_TAKEN_ERROR(7, "No picture captured."),
NO_CAMERA_AVAILABLE_ERROR(8, "No camera available."),
EDIT_IMAGE_ERROR (10, "Couldn't edit image."),
TAKE_PHOTO_ERROR(11, "Couldn't capture picture."),
GET_IMAGE_ERROR(12, "Couldn't get image from the gallery."),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one's being used on iOS, so we can't re-use it for something else on Android right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can use it here instead of GENERIC_CHOOSE_MULTIMEDIA_ERROR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anywhere to use it. @OS-ruimoreiramendes the line you shared can also be returned for videos, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hum yeah, is for both images and videos, so doesn't make sense to use GET_IMAGE_ERROR since specifies images

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah so I don't see anywhere else we can use it - and that's fine

PROCESS_IMAGE_ERROR(13, "Couldn't process image."),
EDIT_CANCELLED_ERROR(14, "Couldn't edit picture because the process was canceled."),
CAPTURE_VIDEO_ERROR(18, "Couldn't capture video."),
CAPTURE_VIDEO_CANCELLED_ERROR(19, "Couldn't capture video because the process was canceled."),
GENERIC_CHOOSE_MULTIMEDIA_ERROR(21, "Couldn't choose media from the gallery."),
CHOOSE_MULTIMEDIA_CANCELLED_ERROR(23, "Couldn't choose media from the gallery because the process was canceled."),
MEDIA_PATH_ERROR(24, "Couldn't get media file path."),
PLAY_VIDEO_GENERAL_ERROR(26, "Couldn't play video."),
EDIT_PICTURE_EMPTY_URI_ERROR(27, "URI parameter cannot be empty."),
FILE_DOES_NOT_EXIST_ERROR(30, "The selected file doesn't exist."),
FETCH_IMAGE_FROM_URI_ERROR(31, "Couldn't retrieve image from the URI."),
PERMISSION_DENIED_ERROR(35, "Permission denied."),
FAILED_TO_CAPTURE_IMAGE_ERROR(36, "Failed to capture image."),
UNABLE_TO_ACCESS_GALLERY_ERROR(37, "Unable to access photo gallery."),
VIDEO_CAPTURE_NOT_SUPPORTED_ERROR(38, "Video capture not supported."),
FILE_NOT_FOUND_OR_INACCESSIBLE_ERROR(39, "File not found or inaccessible."),
EDIT_OPERATION_CANCELLED_ERROR(40, "User canceled the edit operation."),
INVALID_ARGUMENT_ERROR(41, "Invalid argument provided to plugin method."),
FAILED_TO_SAVE_FILE_ERROR(42, "Failed to save file."),
RESOURCE_BUSY_ERROR(43, "Camera or other device resource is busy."),

GALLERY_PERMISSION_DENIED_ERROR(5, "Couldn't access your photo gallery because access wasn't provided."),
NO_PICTURE_TAKEN_ERROR(6, "Couldn't take photo because the process was canceled."),
NO_CAMERA_AVAILABLE_ERROR(7, "No camera available."),
EDIT_IMAGE_ERROR (9, "Couldn't edit image."),
TAKE_PHOTO_ERROR(10, "Couldn't take photo."),
PROCESS_IMAGE_ERROR(12, "Couldn't process image."),
EDIT_CANCELLED_ERROR(13, "Couldn't edit photo because the process was canceled."),
CAPTURE_VIDEO_ERROR(16, "Couldn't record video."),
CAPTURE_VIDEO_CANCELLED_ERROR(17, "Couldn't record video because the process was canceled."),
GENERIC_CHOOSE_MULTIMEDIA_ERROR(19, "Couldn't choose media from the gallery."),
CHOOSE_MULTIMEDIA_CANCELLED_ERROR(21, "Couldn't choose media from the gallery because the process was canceled."),
MEDIA_PATH_ERROR(22, "Couldn't get media file path."),
PLAY_VIDEO_GENERAL_ERROR(24, "Couldn't play video."),
EDIT_PICTURE_EMPTY_URI_ERROR(25, "URI parameter cannot be empty."),
FILE_DOES_NOT_EXIST_ERROR(28, "The selected file doesn't exist."),
FETCH_IMAGE_FROM_URI_ERROR(29, "Couldn't retrieve image from the URI."),
INVALID_ARGUMENT_ERROR(32, "Invalid argument provided to plugin method."),

// Overall Android specific
CONTEXT_ERROR(202, "Unable to get the context.")
CONTEXT_ERROR(34, "Unable to get the context.")
}
Loading