1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-05 02:08:52 +09:00
This commit is contained in:
syuilo 2018-04-05 18:50:52 +09:00
parent 7403f38fb4
commit fd87a63e57
3 changed files with 4 additions and 3 deletions

View File

@ -15,7 +15,7 @@ export default async (value, verifier?: string) => {
object.type !== 'Person' ||
typeof object.preferredUsername !== 'string' ||
!validateUsername(object.preferredUsername) ||
!isValidName(object.name) ||
(object.name != '' && !isValidName(object.name)) ||
!isValidDescription(object.summary)
) {
throw new Error('invalid person');

View File

@ -16,7 +16,7 @@ export default async (username, host, option) => {
const finger = await webFinger(acctLower, acctLower);
const self = finger.links.find(link => link.rel && link.rel.toLowerCase() === 'self');
if (!self) {
throw new Error();
throw new Error('self link not found');
}
user = await resolvePerson(self.href, acctLower);

View File

@ -37,7 +37,8 @@ module.exports = (params, me) => new Promise(async (res, rej) => {
if (typeof host === 'string') {
try {
user = await resolveRemoteUser(username, host, cursorOption);
} catch (exception) {
} catch (e) {
console.warn(`failed to resolve remote user: ${e}`);
return rej('failed to resolve remote user');
}
} else {