@ -1496,7 +1496,7 @@ export default class AccountViewView extends Vue {
const previousApiServer = this . apiServer ;
const newApiServer = this . apiServerInput ;
logger . info ( "[Server Switching] Claim URL change initiated:" , {
logger . debug ( "[Server Switching] Claim URL change initiated:" , {
did : this . activeDid ,
previousServer : previousApiServer ,
newServer : newApiServer ,
@ -1515,7 +1515,7 @@ export default class AccountViewView extends Vue {
} ) ;
/ / L o g s u c c e s s f u l s e r v e r s w i t c h
logger . info ( "[Server Switching] Claim URL change completed:" , {
logger . debug ( "[Server Switching] Claim URL change completed:" , {
did : this . activeDid ,
previousServer : previousApiServer ,
newServer : newApiServer ,
@ -1530,7 +1530,7 @@ export default class AccountViewView extends Vue {
const previousPartnerServer = this . partnerApiServer ;
const newPartnerServer = this . partnerApiServerInput ;
logger . info ( "[Server Switching] Partner server change initiated:" , {
logger . debug ( "[Server Switching] Partner server change initiated:" , {
did : this . activeDid ,
previousServer : previousPartnerServer ,
newServer : newPartnerServer ,
@ -1548,7 +1548,7 @@ export default class AccountViewView extends Vue {
} ) ;
/ / L o g s u c c e s s f u l p a r t n e r s e r v e r s w i t c h
logger . info ( "[Server Switching] Partner server change completed:" , {
logger . debug ( "[Server Switching] Partner server change completed:" , {
did : this . activeDid ,
previousServer : previousPartnerServer ,
newServer : newPartnerServer ,
@ -1935,18 +1935,54 @@ export default class AccountViewView extends Vue {
return null ;
} catch ( error : unknown ) {
/ / H a n d l e s p e c i f i c H T T P s t a t u s c o d e s
/ / H a n d l e s p e c i f i c H T T P s t a t u s c o d e s c l e a n l y t o s u p p r e s s c o n s o l e s p a m
if ( error && typeof error === "object" && "response" in error ) {
const axiosError = error as { response ? : { status ? : number } } ;
if ( axiosError . response ? . status === 404 ) {
logger . debug (
"[AccountViewView] Profile not found (404) - this is normal for new users" ,
logger . info (
"[Profile] No profile found - this is normal for new users" ,
{
did ,
server : this . partnerApiServer ,
status : 404 ,
timestamp : new Date ( ) . toISOString ( ) ,
} ,
) ;
return null ;
}
if ( axiosError . response ? . status === 400 ) {
logger . warn ( "[Profile] Bad request - user may not be registered" , {
did ,
server : this . partnerApiServer ,
status : 400 ,
timestamp : new Date ( ) . toISOString ( ) ,
} ) ;
return null ;
}
if (
axiosError . response ? . status === 401 ||
axiosError . response ? . status === 403
) {
logger . warn ( "[Profile] Authentication/authorization issue" , {
did ,
server : this . partnerApiServer ,
status : axiosError . response . status ,
timestamp : new Date ( ) . toISOString ( ) ,
} ) ;
return null ;
}
}
logger . error ( "[AccountViewView] Failed to load profile:" , error ) ;
/ / O n l y l o g f u l l e r r o r s f o r u n e x p e c t e d i s s u e s ( 5 x x , n e t w o r k e r r o r s , e t c . )
logger . error ( "[Profile] Unexpected error loading profile:" , {
did ,
server : this . partnerApiServer ,
error : error instanceof Error ? error . message : String ( error ) ,
timestamp : new Date ( ) . toISOString ( ) ,
} ) ;
throw new Error ( "Failed to load profile" ) ;
}
}
@ -2003,7 +2039,54 @@ export default class AccountViewView extends Vue {
return true ;
} catch ( error : unknown ) {
logger . error ( "[AccountViewView] Failed to save profile:" , error ) ;
/ / H a n d l e s p e c i f i c H T T P s t a t u s c o d e s c l e a n l y t o s u p p r e s s c o n s o l e s p a m
if ( error && typeof error === "object" && "response" in error ) {
const axiosError = error as { response ? : { status ? : number } } ;
if ( axiosError . response ? . status === 400 ) {
logger . warn ( "[Profile] Bad request saving profile" , {
did ,
server : this . partnerApiServer ,
status : 400 ,
timestamp : new Date ( ) . toISOString ( ) ,
} ) ;
throw new Error ( "Invalid profile data" ) ;
}
if (
axiosError . response ? . status === 401 ||
axiosError . response ? . status === 403
) {
logger . warn (
"[Profile] Authentication/authorization issue saving profile" ,
{
did ,
server : this . partnerApiServer ,
status : axiosError . response . status ,
timestamp : new Date ( ) . toISOString ( ) ,
} ,
) ;
throw new Error ( "Authentication required" ) ;
}
if ( axiosError . response ? . status === 409 ) {
logger . warn ( "[Profile] Profile conflict - may already exist" , {
did ,
server : this . partnerApiServer ,
status : 409 ,
timestamp : new Date ( ) . toISOString ( ) ,
} ) ;
throw new Error ( "Profile already exists" ) ;
}
}
/ / O n l y l o g f u l l e r r o r s f o r u n e x p e c t e d i s s u e s
logger . error ( "[Profile] Unexpected error saving profile:" , {
did ,
server : this . partnerApiServer ,
error : error instanceof Error ? error . message : String ( error ) ,
timestamp : new Date ( ) . toISOString ( ) ,
} ) ;
throw new Error ( "Failed to save profile" ) ;
}
}
@ -2072,7 +2155,47 @@ export default class AccountViewView extends Vue {
return true ;
} catch ( error : unknown ) {
logger . error ( "[AccountViewView] Failed to delete profile:" , error ) ;
/ / H a n d l e s p e c i f i c H T T P s t a t u s c o d e s c l e a n l y t o s u p p r e s s c o n s o l e s p a m
if ( error && typeof error === "object" && "response" in error ) {
const axiosError = error as { response ? : { status ? : number } } ;
if ( axiosError . response ? . status === 404 ) {
logger . info (
"[Profile] Profile not found for deletion - may already be deleted" ,
{
did ,
server : this . partnerApiServer ,
status : 404 ,
timestamp : new Date ( ) . toISOString ( ) ,
} ,
) ;
return true ; / / C o n s i d e r i t s u c c e s s f u l i f a l r e a d y d e l e t e d
}
if (
axiosError . response ? . status === 401 ||
axiosError . response ? . status === 403
) {
logger . warn (
"[Profile] Authentication/authorization issue deleting profile" ,
{
did ,
server : this . partnerApiServer ,
status : axiosError . response . status ,
timestamp : new Date ( ) . toISOString ( ) ,
} ,
) ;
return false ;
}
}
/ / O n l y l o g f u l l e r r o r s f o r u n e x p e c t e d i s s u e s
logger . error ( "[Profile] Unexpected error deleting profile:" , {
did ,
server : this . partnerApiServer ,
error : error instanceof Error ? error . message : String ( error ) ,
timestamp : new Date ( ) . toISOString ( ) ,
} ) ;
return false ;
}
}