Skip to content

Bs 182 SMS Error Code REST API#2967

Merged
jaimecasero merged 16 commits intomasterfrom
BS-182
Jun 15, 2018
Merged

Bs 182 SMS Error Code REST API#2967
jaimecasero merged 16 commits intomasterfrom
BS-182

Conversation

@jaimecasero
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Exposes SMS error codes in REST API
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes # Bs 182

Special notes for your reviewer:

uri MEDIUMTEXT NOT NULL,
smpp_message_id MEDIUMTEXT
smpp_message_id MEDIUMTEXT,
error_code BIGINT
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 would use a text based type instead

@jaimecasero jaimecasero changed the title [WIP] Bs 182 Bs 182 SMS Error Code REST API Jun 13, 2018
* @author mariafarooq
*
*/
public enum Error {
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.

I find this name too generic. Maybe SmsError is more suitable?

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.

agree,its even collisioning with existing class in JDK

}
}

protected void writeError(final Error error, final HierarchicalStreamWriter writer) {
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.

If this is SMS-specific error, why did we create these methods in an generic converter?

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.

agree this converter is getting loaded with specific entity details that will be rarely reused on diff converters,move to specific converter instead

logger.warning("responseMessageId=" + smppMessageId + " was never received!");
} else {
this.storage.getSmsMessagesDao().updateSmsMessage(sms.setSmppMessageId(null).setStatus(deliveryStatus));
sms.setSmppMessageId(null);
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.

CAREFUL!! each setter returns a brand new SMS object

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.

ummm,right this is a bug for sure. I would say lets create a builder with copy constructor instead, this is very dangerous idiom we are using.

return status;
}

private Error parseRestcommErrorCode(String errCode) {
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.

Duplicated logic in ErrorCodeMapper, with difference that code is a String. Can't we maintain consistency in single place?

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.

not really duplicated.one maping is for DLR err codes,the other for submitResp.they are diff mapping as documented

@jaimecasero jaimecasero merged commit 47fb9c7 into master Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants