Skip to content

Commit

Permalink
Merge pull request #14 from OutSystems/feat/RMET-3037/update-error-info
Browse files Browse the repository at this point in the history
RMET-3037 OSBarcodeLib-Android - Update error info
  • Loading branch information
alexgerardojacinto authored Jan 9, 2024
2 parents b731dd8 + d0d3a7e commit 1b316c5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ The changes documented here do not include those from the original repository.

## [Unreleased]

## [1.0.0]

### 09-01-2024
Android - Udpate error codes and messages (https://outsystemsrd.atlassian.net/browse/RMET-3037)

### 19-12-2023
Android - Run image analysis outside of the main/UI thread (https://outsystemsrd.atlassian.net/browse/RMET-2912)

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.outsystems</groupId>
<artifactId>osbarcode-android</artifactId>
<version>0.0.32</version>
<version>1.0.0</version>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ package com.outsystems.plugins.barcode.model
* Enum class that holds the library's errors.
*/
enum class OSBARCError(val code: Int, val description: String) {
CAMERA_PERMISSION_DENIED_ERROR(7, "Scanning cancelled due to missing camera permissions."),
INVALID_PARAMETERS_ERROR(10, "Scanning parameters are invalid."),
SCAN_CANCELLED_ERROR(6, "Scanning cancelled."),
SCANNING_GENERAL_ERROR(4, "Error while trying to scan code."),
ZXING_LIBRARY_ERROR(11, "There was an error scanning the barcode with ZXing."),
MLKIT_LIBRARY_ERROR(12, "There was an error scanning the barcode with ML Kit.")
SCAN_CANCELLED_ERROR(6, "Couldn't scan because the process was cancelled."),
CAMERA_PERMISSION_DENIED_ERROR(7, "Couldn't scan because camera access wasn't provided. Check your camera permissions and try again."),
INVALID_PARAMETERS_ERROR(8, "Scanning parameters are invalid."),
ZXING_LIBRARY_ERROR(9, "There was an error scanning the barcode with ZXing."),
MLKIT_LIBRARY_ERROR(10, "There was an error scanning the barcode with ML Kit.")
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ScanCodeTests {
private const val SCAN_REQUEST_CODE = 112
private const val INVALID_REQUEST_CODE = 113
private const val INVALID_RESULT_CODE = 9
private const val GENERAL_ERROR_CODE = 4
private const val SCAN_RESULT = "scanResult"
private const val RESULT_CODE = "myCode"
}
Expand Down Expand Up @@ -168,7 +169,7 @@ class ScanCodeTests {
Mockito.doReturn(null).`when`(mockBundle).getString(SCAN_RESULT)

val barcodeController = OSBARCController()
barcodeController.handleActivityResult(SCAN_REQUEST_CODE, INVALID_RESULT_CODE, mockIntent,
barcodeController.handleActivityResult(SCAN_REQUEST_CODE, GENERAL_ERROR_CODE, mockIntent,
{
fail()
},
Expand Down

0 comments on commit 1b316c5

Please sign in to comment.