Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var i = {
- AlreadyRetweeted: t,
- BlockedUserError: function(e) {
- switch (e.eventName) {
- case "dataFailedToFavoriteTweet":
- this.showApiErrorToast(o.a.BLOCKED_FROM_LIKE);
- break;
- case "dataFailedToRetweet":
- this.showApiErrorToast(o.a.BLOCKED_FROM_RETWEET);
- break;
- default:
- this.showApiErrorToast(o.a.BLOCKED_DEFAULT)
- }
- },
- CurrentUserSuspended: function(e) {
- a.a.user.needsPhoneVerification ? this.showApiErrorToast(o.a.PLEASE_ADD_PHONE_TO_FINISH) : this.showApiErrorToast(o.a.SUSPENDED_DEFAULT)
- },
- DeactivatedUser: e(o.a.SORRY_COULD_NOT_FIND_USER),
- DeniedByApiCsrfProtection: t,
- DeviceAlreadyRegistered: e(o.a.DEVICE_ALREADY_REGISTERED),
- DeviceOperatorUnsupported: e(o.a.DEVICE_OPERATOR_UNSUPPORTED),
- DeviceRegistrationGeneralError: e(o.a.DEVICE_REGISTRATION_GENERAL_ERROR),
- DirectMessageCannotDmOtherUser: e(o.a.CANNOT_MESSAGE_THIS_ACCOUNT),
- DirectMessageDuplicate: e(o.a.WHOOPS_YOU_ALREADY_SAID_THAT),
- DirectMessageTooLongError: e(o.a.DM_TOO_LONG),
- DuplicateFavorite: t,
- FollowRateLimitExceeded: e(o.a.FOLLOW_RATE_LIMITED),
- ForbiddenMissingParameter: e(o.a.YOUR_ACCOUNT_MAY_NOT_BE_ALLOWED),
- GenericBadRequest: e(o.a.WE_DID_SOMETHING_WRONG),
- GenericNotFound: e(o.a.WE_DID_SOMETHING_WRONG),
- GenericSuspended: function(e) {
- a.a && a.a.user && a.a.user.needsPhoneVerification ? this.showApiErrorToast(o.a.PLEASE_ADD_PHONE_TO_FINISH) : this.showApiErrorToast(o.a.ACCOUNT_SUSPENDED)
- },
- GenericUserNotFound: e(o.a.SORRY_COULD_NOT_FIND_USER),
- InactiveUser: e(o.a.SUSPENDED_DEFAULT),
- InternalError: e(o.a.WE_DID_SOMETHING_WRONG),
- InvalidCredentials: e(o.a.YOUR_ACCOUNT_MAY_NOT_BE_ALLOWED),
- InvalidCurrentPassword: e(o.a.INVALID_CURRENT_PASSWORD),
- InvalidMediaId: e(o.a.INVALID_MEDIA),
- InvalidRequestUrlForbidden: e(o.a.CANNOT_ATTACH_MEDIA),
- OtherUserSuspended: e(o.a.ACCOUNT_SUSPENDED),
- OverCapacity: e(o.a.API_OVER_CAPACITY),
- RateLimitExceeded: e(o.a.SORRY_RATE_LIMITED),
- StatusNotFound: e(o.a.TWEET_IS_DELETED),
- StatusNotFoundForbidden: e(o.a.TWEET_IS_DELETED),
- TieredActionChallengeCaptcha: e(o.a.REQUEST_LOOKS_AUTOMATED),
- TieredActionFavoriteSpammer: e(o.a.REQUEST_LOOKS_AUTOMATED),
- TieredActionFollowCreeper: e(o.a.CREEPER_FOLLOW),
- TieredActionTweetCreeper: e(o.a.CREEPER_TWEET),
- UserActionRateLimitExceeded: e(o.a.DAILY_RATE_LIMIT_ADD_PHONE),
- UserAlreadyHasVerifiedPhone: e(o.a.USER_ALREADY_HAS_VERIFIED_PHONE),
- UserMustBeAlcoholAgeScreened: function(e) {
- e.eventName
- },
- ValidationFailure: function(e) {
- if ("dataMuteKeywordsAddKeywordFailed" === e.eventName) {
- var t = e.data.errors[0].message;
- this.trigger("dataMuteKeywordsAddKeywordFailure", {
- error_message: t
- })
- }
- },
- IneligibleFor2faAfterModification: t
- };
- this.showApiErrorToast = function(e) {
- this.trigger("uiShowError", {
- message: e
- })
- }, this.getApiErrorDataField = function(e, t) {
- return e && e.errors && e.errors[0] ? e.errors[0][t] : void 0
- }, this.handleApiError = function(e, t, n, a) {
- if (void 0 !== t) {
- var s = i[o.b[t]];
- void 0 !== s ? s.call(this, {
- eventName: e,
- data: a
- }) : this.showApiErrorToast(Object(r.default)("Sorry, something went wrong."))
- } else void 0 !== n && (429 === n ? this.trigger("uiShowError", {
- message: o.a.SORRY_RATE_LIMITED
- }) : 403 === n && this.trigger("uiShowError", {
- message: o.a.YOUR_ACCOUNT_MAY_NOT_BE_ALLOWED
- }));
- return Promise.resolve()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement